diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2016-04-04 05:49:48 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2016-04-04 05:49:48 +0000 |
commit | ae547e474acac7148b2ecc0fe2d5c6e06c771c42 (patch) | |
tree | c18efa88c6b53bb5d6141ba683c9e7be9e7055f5 /usr.bin/grep | |
parent | 6e17fb0fec962718d79ef22797351a9732391160 (diff) |
Reverse search optimization makes no sense (and doesn't work) if
we are looking for all matches in a line; ok natano@ miilert@ tedu@
Diffstat (limited to 'usr.bin/grep')
-rw-r--r-- | usr.bin/grep/util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c index bda784a0de8..617a684bff5 100644 --- a/usr.bin/grep/util.c +++ b/usr.bin/grep/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.54 2015/12/22 19:35:50 mmcc Exp $ */ +/* $OpenBSD: util.c,v 1.55 2016/04/04 05:49:47 otto Exp $ */ /*- * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav @@ -391,7 +391,7 @@ nonspecial: * Determine if a reverse search would be faster based on the placement * of the dots. */ - if ((!(lflag || cflag)) && ((!(bol || eol)) && + if ((!(lflag || cflag || oflag)) && ((!(bol || eol)) && ((lastHalfDot) && ((firstHalfDot < 0) || ((fg->patternLen - (lastHalfDot + 1)) < firstHalfDot))))) { fg->reversedSearch = 1; |