buggrep - Bugs: bug #27196, Using -o and -i options together...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #27196: Using -o and -i options together is broken

Submitted by:  None
Submitted on:  Thu 06 Aug 2009 11:52:00 PM UTC  
 
Category: NoneSeverity: 4 - Important
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Wed 17 Mar 2010 08:25:28 AM UTC, comment #5:

Thank you for the bug report. This bug has been fixed in the
development sources, which can be downloaded using git from
git://git.sv.gnu.org/grep.git

Paolo Bonzini <bonzini>
Mon 08 Mar 2010 08:53:03 AM UTC, comment #4:

Work-in-progress patch posted to mailing list.

Paolo Bonzini <bonzini>
Tue 15 Dec 2009 01:14:15 PM UTC, comment #3:

Included regex doesn't support ignore-icase-matching.

Then, it converts patterns and texts to the lower case
before matching.

However, when MB_CUR_MAX is equal to 1,
patterns isn't converted to lower case.

Norihirio Tanaka <noritnk>
Fri 04 Dec 2009 12:09:41 PM UTC, comment #2:

$ echo abcDEF | ./grep -o -i C.E
cDE
$ echo abcDEF | LANG=en_US.ASCII ./grep -o -i C.E
$

Happens irregardless of --with/--without-included-regex

Paolo Bonzini <bonzini>
Fri 07 Aug 2009 07:40:30 AM UTC, comment #1:

Not reproduced. Please give us more information as LANG, LC_ALL, etc.

$ ./grep --version
GNU grep 2.5.4

Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ ./grep -o -i HELLO testfile
Hello
$ ./grep -o -i hello testfile
Hello

Norihirio Tanaka <noritnk>
Thu 06 Aug 2009 11:52:00 PM UTC, original submission:

Hi,

Using -i with -o produces unexpected results.

testfile contains:
Bonjour le monde.
Hello world.
Bonjour le monde.

But the command:
grep -o -i HELLO testfile
produces no output.

If I specify the pattern in all lowercase (grep -o -i hello testfile), I get the expected result:
Hello

I would expect it to work the same regardless of the case of the pattern, since -i means ignore case. If -o is not specified, the case of the pattern does not matter.

I have tested in both 2.5.4 and 2.6-cvs.

Anonymous

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bonzini (Posted a comment)
  • -unavailable- added by noritnk (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 17 Mar 2010 08:25:28 AM UTCbonziniStatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
    Mon 08 Mar 2010 08:53:03 AM UTCbonziniSeverity3 - Normal=>4 - Important
      StatusNone=>In Progress

    Back to the top


    Powered by Savane 3.1-cleanup1