bug-gnu-utils
[Top][All Lists]
Advanced

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

locale / char class bug in GNU grep 2.5.1


From: Benjamin Elijah Griffin
Subject: locale / char class bug in GNU grep 2.5.1
Date: Fri, 7 Nov 2003 10:15:45 -0800

Problem: with -i character classes are at least sometimes not case
insensitive. This seems to depend on locale setting.

Here is a sample of the problem in action. It is repeatable for me every
time. Prompt is ":r! ". The pattern should match for every case, instead
for the third case, with a character in [] which needs case folding and
with the LANG set, there is no match.

:r! cat /tmp/QZ
-0555 402200    Oct 27 12:56:11 2002    ./Digitial Camera/2002-10-30/wood Q.jpg
:r! grep -i 'wood.*q' /tmp/QZ || echo not found
-0555 402200    Oct 27 12:56:11 2002    ./Digitial Camera/2002-10-30/wood Q.jpg
:r! grep -i 'wood.*[q]' /tmp/QZ || echo not found
not found
:r! grep -i 'WOOD.*[Q]' /tmp/QZ || echo not found
-0555 402200    Oct 27 12:56:11 2002    ./Digitial Camera/2002-10-30/wood Q.jpg
:r! /bin/env -u LANG grep -i 'wood.*[q]' /tmp/QZ || echo not found
-0555 402200    Oct 27 12:56:11 2002    ./Digitial Camera/2002-10-30/wood Q.jpg
:r! echo LANG=$LANG
LANG=en_US.UTF-8
:r! grep --version
grep (GNU grep) 2.5.1

Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

My first instinct was this is a locale bug, but since grep seems to manage
case folding fine outside of character classes, it looks more like a grep
bug. This is running on a fairly stock RedHat 8.0 system, if it helps.

Benjamin




reply via email to

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