bug-gnulib
[Top][All Lists]
Advanced

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

Re: bug in basename


From: Eric Blake
Subject: Re: bug in basename
Date: Thu, 14 May 2009 22:16:36 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.6.666

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

According to Ondrej Bilka on 5/14/2009 7:47 AM:
> Hello,
> I realized my fnmatch implementation contains this bug:
> For encodings like BIG5 if character contains / it could quit prematurely.
> I fixed it by ingoring FNM_PATHNAME till check phase.
> But as I looked how it is handled in basename.c it isnt handled at all. glibc 
> basename too ignores this.

You'd have to convince glibc that this is a bug, first.  Really, file
names are just byte strings where / is special, and not character
encodings dependent on your locale (except on Mac, and look at the
problems that caused).  BIG5 is a lousy character encoding for the very
reason that it confuses common ASCII bytes with encoded characters,
depending on shift state.  But kernel calls that operate on file names,
and thus library operations like basename that prepare file names for use
in kernel calls, are locale-agnostic.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkoM7KQACgkQ84KuGfSFAYB4awCfRQAV8TeSg9Rby8hTtZ94VS0d
wEwAn2i5UpExEVPEa+z5B5qcJBqt9TfT
=ricZ
-----END PGP SIGNATURE-----




reply via email to

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