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

Submitter:  None
Submitted:  Wed 31 Mar 2010 12:30:47 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Invalid
Privacy:  Public Assigned 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

 

(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 dicks (Posted a comment)
  • -email is unavailable- added by bonzini (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
    2010-04-01 bonzini StatusNone Invalid
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code