[patch/libiberty] IS_ABSOLUTE_PATH to handle both DOS and POS IX p ath styles

DJ Delorie dj@redhat.com
Fri Jan 4 22:43:00 GMT 2008


> I simply followed existing logic. In the code it says:
> 
> #define IS_DIR_SEPARATOR(c)     ((c) == '/' || (c) == '\\')
> /* Note that IS_ABSOLUTE_PATH accepts d:foo as well, although it is
>    only semi-absolute.  This is because the users of IS_ABSOLUTE_PATH
>    want to know whether to prepend the current working directory to
>    a file name, which should not be done with a name like d:foo.  */
> #define IS_ABSOLUTE_PATH(f)     (IS_DIR_SEPARATOR((f)[0]) || (((f)[0]) &&
> ((f)[1] == ':'))) 

Perhaps we should have a similar comment on the new ones, or at least
a "see comment for ..."  comment.

> > Why X and not POSIX?  The X window system doesn't define any path
> > separators.
>
> No good reason. It was shorter I guess.

Ah, the creat mentality.  Let's spell it out, please.



More information about the Gcc-patches mailing list