This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch/libiberty] IS_ABSOLUTE_PATH to handle both DOS and POS IX p ath styles
- From: DJ Delorie <dj at redhat dot com>
- To: ARistovski at qnx dot com
- Cc: gcc-patches at gcc dot gnu dot org, drow at false dot org, RMansfield at qnx dot com
- Date: Fri, 4 Jan 2008 15:53:08 -0500
- Subject: Re: [patch/libiberty] IS_ABSOLUTE_PATH to handle both DOS and POS IX p ath styles
- References: <2F6320727174C448A52CEB63D85D11F40A53@nova.ott.qnx.com>
> 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.