-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Paul Eggert on 11/10/2005 6:44 PM: > > This makes it sound like we cannot implement base_name using the > current approach. Currently, base_name always returns a suffix of the > original file name. But under Cygwin if the file name is "a:b:c", > base_name cannot return "b:c", since that does not have the desired > POSIX property that you can chdir to the dir_name and then use the > base_name.
In cygwin, a:b:c is treated like a:/b:c, but that is not a valid filename (managed mounts, where : is legal inside a name, cannot be located at a drive root). So, the POSIX formula that a valid filename decomposes into a valid dir and basename does not need to apply in this case. Cygwin basename(3) in <libgen.h> solves this particular example by having dirname return "a:" and basename return "a:b:c". In other words, in this case, base_name still returns a valid filename with no slash characters, which happens to resemble an absolute pathname, and neither the original nor the base_name result are valid filenames. Since I had not contemplated this corner case before your mail, I will update my testsuite before resubmitting my patch. On the other hand, on cygwin, "./a:b" is a valid name whose base_name is unambiguously "a:b" per POSIX, but since a:b is treated as an absolute filename, this example violates the premise that the basename is the desired file. But here, cygwin's basename(3) returned "a:b", so I don't think it is worth complicating base_name for this extreme corner case (cygwin managed mounts are documented to support all possible Unix pathnames gracefully except for the cases of \ still being a directory separator, and files starting with a drive letter prefix cannot be referenced without a directory separator). - -- Life is short - so eat dessert first! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDdCAY84KuGfSFAYARAiJkAJ9n5LF+sSl4y5tWsDdpd3PJGnsgGgCeNU70 YFn3RnEUDd/5WGQuYTUQGLY= =xKsn -----END PGP SIGNATURE----- _______________________________________________ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib