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

Submitter:  None
Submitted:  Tue 03 Nov 2009 04:45:17 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned 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

 

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

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
  • -email is unavailable- added by bonzini (Posted a comment)
  • -email is unavailable- added by chrisj (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-12-04 bonzini Open/ClosedOpen Closed
    2009-11-03 None Attached File- Added test.txt, #18981

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code