This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [patch/libiberty] IS_ABSOLUTE_PATH to handle both DOS and POS IX p ath styles


> 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.


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