summaryrefslogtreecommitdiff
path: root/usr.bin/grep/util.c
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2004-08-11 13:18:59 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2004-08-11 13:18:59 +0000
commitf9b86f7df824fc5f7471ed04d8fba07031a71e2c (patch)
tree08e20ecd1dce54af5a80dc3bb9f3a8df18acacab /usr.bin/grep/util.c
parent4c4ddbad62d0fdd2fbef6f6b16b90509443b069a (diff)
Stop search when -q option is given and a match is found. Found by jmc@
ok millert@
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 c0a019197a7..89a9e163f99 100644
--- a/usr.bin/grep/util.c
+++ b/usr.bin/grep/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.26 2004/05/07 19:06:59 otto Exp $ */
+/* $OpenBSD: util.c,v 1.27 2004/08/11 13:18:58 otto Exp $ */
/*-
* Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
@@ -123,7 +123,7 @@ procfile(char *fn)
if (Bflag > 0)
initqueue();
- for (c = 0; !(lflag && c);) {
+ for (c = 0; c == 0 || !(lflag || qflag); ) {
ln.off += ln.len + 1;
if ((ln.dat = grep_fgetln(f, &ln.len)) == NULL)
break;