Up to [local] / src / usr.bin / grep
Request diff between arbitrary revisions
Default branch: MAIN
Current tag: OPENBSD_3_5_BASE
Revision 1.10 / (download) - annotate - [select for diffs], Sun Jan 25 21:36:00 2004 UTC (20 years, 4 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE,
OPENBSD_3_5
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)
Previously, in -w mode, for each match on a line grep would check to see if the match was on a word boundary. However, this missed lines where the first match was not on a word boundary but a subsequent match was. Problem originally spotted by miod@ We fix this by using the [[:<:]] and [[:>:]] character classes for the slow path and by checking the word boundaries in grep_search() for the fast path instead of doing the checks after running regexec() or grep_search(). With this change, grep passes the new regress tests 15 and 16. problem originally spotted by espie@.