Eric Blake <[EMAIL PROTECTED]> writes:

> On the other hand, on cygwin, "./a:b" is a valid name whose base_name is
> unambiguously "a:b" per POSIX,

We needn't conform strictly to the POSIX spec as far as slashes go;
otherwise we'd be forced to treat "a/b" as not having a directory
separator.

The point is that dir_name(FOO) should return the directory that FOO
is in, and base_name(FOO) should return a file name that identifies
FOO if the working directory is dirname(FOO).  For this example on
Cygwin, it appears that dir_name("./a:b") should be "." (since that's
the directory that the file is in) and base_name("./a:b") should be
"./a:b" (since "a:b" won't do).  For all the examples you've given so
far, it is the case that base_name(FOO) can return a suffix of FOO,
no?

Similarly, dir_name("//") should be "//" and base_name("//") should be
"//" on Cygwin (I guess -- I keep forgetting how Cygwin works).

> I don't think it is worth complicating base_name for this extreme
> corner case

Hmm, I'm not sure I agree.  As long as we're trying to handle these
weird DOS names, we might as well handle all the cases.  It's not that
hard, is it?


_______________________________________________
bug-gnulib mailing list
bug-gnulib@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnulib

Reply via email to