bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bugs in dirname module - gnulib portion


From: Paul Eggert
Subject: Re: bugs in dirname module - gnulib portion
Date: Tue, 22 Nov 2005 11:06:39 -0800
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Eric Blake <address@hidden> writes:

>> Also, what's the point of DIRECTORY_SEPARATOR?  Can't we just use '/'?
>
> I kept it with DIRECTORY_SEPARATOR, in case the application sets
> DIRECTORY_SEPARATOR to '\\' in config.h; after all, systems with drive
> letters have users that are used to the backslash.  But I don't have any
> problem with hard-coding it to '/' if others agree.  Or should I change it
> to check ISSLASH (base[-1]), in which case use the existing spelling?  So
> for 'a/b:c', use './b:c', for 'a\b:c', use '.\b:c', and for 'a:b:c', use
> './b:c'?

I'd rather keep the code simpler, even if it causes the file names to
use '/' rather than '\'.  (That's why I prefer '/' to
DIRECTORY_SEPARATOR.)


> +                 ? (DOUBLE_SLASH_IS_DISTINCT_ROOT
> +                    && ISSLASH (file[1]) && ! ISSLASH (file[2])
> +                    ? 2 : 1)

A minor point: the if-part needs parenthesization, so that the '&&'
and the '?' do not have equal indentation (which is misleading).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]