bug-gnulib
[Top][All Lists]
Advanced

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

Re: bugs in dirname module


From: Eric Blake
Subject: Re: bugs in dirname module
Date: Wed, 09 Nov 2005 21:18:28 -0700
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Paul Eggert on 11/9/2005 2:19 PM:
> 
> However: what happens in DOS if you use a file name like "@:/a/b/c"?

In DOS, : is an invalid character, so the file name is outright rejected
when passed to a function that actually visits the disk.  But POSIX
requires that basename(1) and dirname(1) operate even in the presence of
invalid file names, without checking for existance or legality.

On cygwin, : can be a valid file character (cygwin has managed mounts,
where cygwin transparently translates the names in use by the program into
valid characters for the file system).  There, drive letters are exactly
[A-Za-z]:, and all other leading characters (besides slashes, of course),
are treated as a relative pathname from ./ rather than a drive designator.

> Is this parsed as an invalid file letter, and then rejected, or as a
> file name that's much like "@_/a/b/c" but just happens to have an
> colon rather than an underscore?  If the former, then surely dirname
> should not bother to check whether the first character is a letter.

Dirname really does need to check the first character for correctness on
cygwin.

- --
Life is short - so eat dessert first!

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

iD8DBQFDcsoS84KuGfSFAYARAstiAKCYECXbkcK9zww6hwQYQLDAoEPK5ACgrNV5
/92BFZApq/6gyrmUapWTQV8=
=NxxZ
-----END PGP SIGNATURE-----




reply via email to

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