summaryrefslogtreecommitdiffstats
path: root/usr.bin/grep/util.c
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2016-04-04 05:49:47 +0000
committerotto <otto@openbsd.org>2016-04-04 05:49:47 +0000
commit19f8bc08c6facb51ffc96c95cef5f64b07da4cfe (patch)
tree6d562d001dfc719c86dcce1fc38d227eedb83c42 /usr.bin/grep/util.c
parentuse fixed size unsigned variables for reading/writing the control register (diff)
downloadwireguard-openbsd-19f8bc08c6facb51ffc96c95cef5f64b07da4cfe.tar.xz
wireguard-openbsd-19f8bc08c6facb51ffc96c95cef5f64b07da4cfe.zip
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/util.c')
-rw-r--r--usr.bin/grep/util.c4
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;