From 19f8bc08c6facb51ffc96c95cef5f64b07da4cfe Mon Sep 17 00:00:00 2001 From: otto Date: Mon, 4 Apr 2016 05:49:47 +0000 Subject: Reverse search optimization makes no sense (and doesn't work) if we are looking for all matches in a line; ok natano@ miilert@ tedu@ --- usr.bin/grep/util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin/grep/util.c') 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; -- cgit v1.2.3-59-g8ed1b