[Top][All Lists]

[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: Gecko/20090302 Thunderbird/ Mnenhy/

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
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


reply via email to

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