Package: grep
Version: 2.5.1.ds2-6

On my amd64 debian box using locale
fi_FI.UTF-8 (all LC_XXX variables set to fi_FI.UTF-8 as well as LANG) grep
fails to handle character ranges correctly. For example, the first grep is
wrong but the second works correctly:
$ echo "w" | grep "[a-z]"
$ echo "a" | grep "[a-z]"
a

I've gone through all the letters from a to z, and only the letters v and w
break grep as above! Another user reported that this breakeage does not
happen on his 32-bit Debian with grep 2.5.1.ds2-4, but it does happen on
Debian Lenny 64-bit using grep 2.5.1.ds2-6. Yet another user reported that
he cannot reproduce the problem on a 32-bit system using grep 2.5.1.ds2-6.

Changing locale to C or en_US solves the problem:

$ echo "w" | LC_ALL=C grep "[a-z]"
w
$ echo "w" | LC_ALL=en_US grep "[a-z]"
w

UTF-8 does not seem to matter:

$ echo "w" | LC_ALL=fi_FI grep "[a-z]"

gives nothing (I have locales fi_FI.UTF-8, fi_FI and en_US generated).

My system:
- custom kernel 2.6.22.1
- libc6 2.6.1-1
- Debian Lenny/Sid/Experimental amd64

Reply via email to