[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug] [[ $'\Ux' = $'\Ux' ]] returns false for some values of x in so
Re: [bug] [[ $'\Ux' = $'\Ux' ]] returns false for some values of x in some locales
Sat, 5 Nov 2016 12:26:34 -0400
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.4.0
On 11/4/16 8:29 AM, Stephane Chazelas wrote:
> Most of the problematic characters are the ones ending in 0x5c
> (which happens to be backslash in ASCII (or in BIG5-HKSCS when
> standing alone).
There are a couple of issues here. The first is that the glibc locales
really do have a problem for ca/ea/cb/eb, since the locales on Mac OS X
don't produce any error. The second is that all the rest of the failing
tests are the ones where the pattern ends in a backslash.
For many years, since at least 1997 when the full Posix.2 pattern matching
code came in, patterns ending with a backslash fail to match
unconditionally. I can't find anything specifically referring to this
particular change -- it was pretty much a complete fnmatch rewrite -- and
the rationale has faded in the intervening 20 years. I think it's safe at
this point to allow a trailing backslash in a pattern to match a trailing
backslash in the string.
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU address@hidden http://cnswww.cns.cwru.edu/~chet/
Description: OpenPGP digital signature