buggrep - Bugs: bug #29394, Incorrect matches with grep -w

 
 

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

bug #29394: Incorrect matches with grep -w

Submitted by:  None
Submitted on:  Wed 31 Mar 2010 12:30:47 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Invalid
Privacy: PublicAssigned to: None
Open/Closed: Closed

Wed 31 Mar 2010 07:20:33 PM UTC, comment #2:

It looks like the bug is not in the original grep, but in a Debian (and Ubuntu) patch. I compiled version 2.5.4 from the original sources, and it doesn't show the problem. When I revert 65-dfa-optional.patch in the Debian package, the problem disappears. I guess I should file a bug report with Debian instead...

Dick Streefland <dicks>
Wed 31 Mar 2010 04:30:30 PM UTC, comment #1:

I cannot reproduce it on Fedora (Red Hat patched 2.5.3) or 2.6.x.

Can you try with 2.6.2?

Thanks.

Paolo Bonzini <bonzini>
Wed 31 Mar 2010 12:30:47 PM UTC, original submission:

In some situations, grep (and egrep) return incorrect results when the -w option is used. Example:

$ cat bug
/ABC/
x
/ABCD/
/ABCD/
$ grep -w ABC bug
/ABC/
/ABCD/
$ LC_CTYPE=C grep -w ABC bug
/ABC/

The incorrect second match only occurs when the preceding line is exactly 1 character long. With LC_CTYPE=C, the problem disappears.

$ 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.

$ locale
LANG=
LC_CTYPE=en_US.utf8
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE=POSIX
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

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 dicks (Posted a comment)
  • -unavailable- added by bonzini (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
    Thu 01 Apr 2010 07:51:35 AM UTCbonziniStatusNone=>Invalid
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1