This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] xfullpath and new regression test xfullpath.exp


> Date: Wed, 3 Apr 2002 15:19:09 +0200
> From: Joel Brobecker <brobecker@ACT-Europe.FR>
> 
> > >    if (IS_DIR_SEPARATOR (real_path[strlen (real_path) - 1]))
> > >      result = concat (real_path, base_name, NULL);
> > >    else
> > >      result = concat (real_path, SLASH_STRING, base_name, NULL);
> > 
> > Yes, I think this is better, thanks.
> > 
> > > (can I consider that SLASH_STRING will always be one character long?):
> > 
> > Where does the code assume it's a single character?  `concat' conses
> > up a new string, right?  If so, the length of SLASH_STRING shouldn't
> > matter, I think.  Or am I missing something?
> 
> I implicitely make this assumption when I use the IS_DIR_SEPARATOR
> macro to check the value of the last character in the real_path string,
> and then use SLASH_STRING during the concat.

You don't need to worry about that: it's IS_DIR_SEPARATOR's job to
DTRT for each platform, even if the directory separator is not a
single character.

> If all is fine, I'll resubmit a new patch shortly.

Please do.  Thanks.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]