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

Submitter:  None
Submitted:  Thu 06 Aug 2009 11:52:00 PM UTC
   
 
Category:  None Severity:  4 - Important
Item Group:  None Status:  Fixed
Privacy:  Public Assigned 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

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-03-17 bonzini StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2010-03-08 bonzini Severity3 - Normal 4 - Important
        StatusNone In Progress

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code