buggrep - Bugs: bug #27919, possible glitch with -i and...

 
 

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

bug #27919: possible glitch with -i and character class

Submitted by:  None
Submitted on:  Tue 03 Nov 2009 04:45:17 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Closed

Fri 04 Dec 2009 07:07:52 PM UTC, comment #2:

Fixed, see comment #1

Paolo Bonzini <bonzini>
Thu 05 Nov 2009 08:28:07 AM UTC, comment #1:

Sorry for the report, I see now that this was already known and fixed.

My report seems to be the same as that reported in Bug 16567:

https://savannah.gnu.org/bugs/?16567

I also see the following known bug note in the README for v2.5.4:

"The option -i does not work properly in some multibyte locales such as tr_TR.UTF-8 where the upper case and lower case forms of a character are not necessarily of the same byte length."

I was able to verify that the issue I reported is not present in version (v2.5.4) as obtained through MacPorts ( http://www.macports.org/ ).

Thanks and sorry again!

Chris J <chrisj>
Tue 03 Nov 2009 04:45:17 AM UTC, original submission:

There seems to be some sort of glitch with character classes and the -i (--ignore-case) switch.

I am using Mac OS X 10.6.1 (Snow Leopard).

grep --version shows v2.5.1.

I have not checked the latest grep version. Hopefully you can do that without too much trouble.

To reproduce--

Create a text file called "test.txt" that consists of a single line of text with the two letters T and K followed by a unix line feed, as shown below (also see the attached file):

TK

(I did not attempt to reduce the test case further or see if the particular choice of letters matters.)

The case-insensitive search "grep -i [A-Z]K test.txt" finds no matches while the same search done case-sensitively (i.e. without the -i switch) does find a match. See below for a console session that shows a couple other related searches that work.

$ grep [A-Z]K test.txt
TK
$ grep [T]K test.txt
TK
$ grep -i [T]K test.txt
TK
$ grep -i [^A-Z]K test.txt
TK
$ grep -i [A-Z]K test.txt
$

I have also e-mailed this information to the bug-gnu-utils address.

Thanks,
--Chris

Anonymous

 

Attached Files
file #18981:  test.txt added by None (3B - text/plain - Test case (one line file with letters T and K))

 

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 chrisj (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 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 04 Dec 2009 07:07:51 PM UTCbonziniOpen/ClosedOpen=>Closed
    Tue 03 Nov 2009 04:45:17 AM UTCNoneAttached File-=>Added test.txt, #18981

    Back to the top


    Powered by Savane 3.1-cleanup1