[Top][All Lists]

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

Re: bugs in dirname module

From: Paul Eggert
Subject: Re: bugs in dirname module
Date: Thu, 10 Nov 2005 21:57:23 -0800
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Eric Blake <address@hidden> 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

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,

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?

reply via email to

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