Bug 118084 - grep fails for uppercase expr. and -i and (-o or --color)
grep fails for uppercase expr. and -i and (-o or --color)
Product: Red Hat Linux
Classification: Retired
Component: grep (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Depends On:
  Show dependency treegraph
Reported: 2004-03-11 15:17 EST by Thomas Steudten
Modified: 2007-04-18 13:04 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-03-12 04:32:44 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Thomas Steudten 2004-03-11 15:17:43 EST
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 15:20:33 EST
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 04:32:44 EST
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 07:10:04 EST
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 07:13:19 EST
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.