Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 156105 - grep -Fw matches non-word
Summary: grep -Fw matches non-word
Alias: None
Product: Fedora
Classification: Fedora
Component: grep
Version: 3
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Mike McLean
Depends On:
TreeView+ depends on / blocked
Reported: 2005-04-27 16:26 UTC by Gordon Lack
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2005-04-27 16:59:33 UTC

Attachments (Terms of Use)

Description Gordon Lack 2005-04-27 16:26:07 UTC
Description of problem:

  grep -Fw may find an incorrect match

Version-Release number of selected component (if applicable):


How reproducible:

   Every time.

Steps to Reproduce:
   Run grep -fW with 2 words to match, one which matches the end of a word and
the other teh start of the same word. But neither matches a whole word (well,
that seems to be the requirement).
Actual results:

   grep reports a match:

Expected results:

   grep should not report a match

Additional info:
   A specific example for grep built from the source rpm, with all patches applied.

my-system*[1] echo "LIN7C 55327" | ../grep-2.5.1a/src/grep -wF -e 5327 -e 5532 
LIN7C 55327

   This is grep-specific rather than FC3-specific.  Compiling the same code on
an Irix system produces the same error.

Comment 1 Tim Waugh 2005-04-27 16:59:33 UTC
Confirmed with 2.5.1-31.4.

This works fine in 2.5.1-48 from rawhide (Fedora Core development).

Note You need to log in before you can comment on or make changes to this bug.