Red Hat Bugzilla – Bug 156105
grep -Fw matches non-word
Last modified: 2007-11-30 17:11:04 EST
Description of problem:
grep -Fw may find an incorrect match
Version-Release number of selected component (if applicable):
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).
grep reports a match:
grep should not report a match
A specific example for grep built from the source rpm, with all patches applied.
my-system* echo "LIN7C 55327" | ../grep-2.5.1a/src/grep -wF -e 5327 -e 5532
This is grep-specific rather than FC3-specific. Compiling the same code on
an Irix system produces the same error.
Confirmed with 2.5.1-31.4.
This works fine in 2.5.1-48 from rawhide (Fedora Core development).