Bug 118084 - grep fails for uppercase expr. and -i and (-o or --color)
Summary: grep fails for uppercase expr. and -i and (-o or --color)
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: grep
Version: 9
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Tim Waugh
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2004-03-11 20:17 UTC by Thomas Steudten
Modified: 2007-04-18 17:04 UTC (History)
0 users

Clone Of:
Last Closed: 2004-03-12 09:32:44 UTC

Attachments (Terms of Use)
patch to fix -oi uppercase regex. on RH9 (3.54 KB, patch)
2004-03-11 20:20 UTC, Thomas Steudten
no flags Details | Diff

Description Thomas Steudten 2004-03-11 20:17:43 UTC
Description of problem:
In Context of Bug 72641 with given patch from there for -o and -i
grep-2.5.1-7 has patch grep-2.5.1-oi.patch included.
Maybe the problem is in context to a bug in glibc (glibc-2.3.2-11.9).

grep with -i and uppercase expr. and -o and/or --color gives wrong/ no
With -F or -P it works fine. grep -i without -o --color works fine for
all options of -G,F,E,P.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. echo "one tEst here" | grep -oi TEST
2. echo "one tEst here" | grep -i --color=auto TEST
3. echo "one tEst here" | grep -Fi --color=auto TEST
4. echo "one tEst here" | grep -io --color=auto TEST

Actual Results:  1. nothing
2. one tEst here (no color highlight)
3. one *tEst* here (highlight word between **)
4. nothing

Expected Results:  1. tEst or test or TEST
2. one *tEst* here (highlight word between **)
3. one *tEst* here (highlight word between **)
4. *tEst* or *test* 

Additional info:

Check with different matchers: -F,G,E,P ..

Comment 1 Thomas Steudten 2004-03-11 20:20:33 UTC
Created attachment 98463 [details]
patch to fix -oi uppercase regex. on RH9

Simple solution for grep Gcompile and Ecompile. No time overhead. Use no
translation table.

Comment 2 Tim Waugh 2004-03-12 09:32:44 UTC
This is fixed in the current Fedora Core 1 package, grep-2.5.1-17.4
(in a different manner, using RE_ICASE).

A pending update for Red Hat Linux 9 also contains this fix.

Comment 3 Thomas Steudten 2004-03-12 12:10:04 UTC
Fix with RE_ICASE?!
Looks like fix with the translation table, there's no RE_ICASE
in the sources after patching ;-)

Comment 4 Tim Waugh 2004-03-12 12:13:19 UTC
Sorry, I meant that the pending update uses RE_ICASE to fix -o -i
problems, and current rawhide already does.

Note You need to log in before you can comment on or make changes to this bug.