summaryrefslogtreecommitdiff
path: root/usr.bin/grep
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2021-12-28 16:27:54 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2021-12-28 16:27:54 +0000
commit47f649c2e1c45e5a837bdc8588382901a538dd29 (patch)
tree4d9426e3c4292f461bbcbafa3c355a74f478ec7d /usr.bin/grep
parent62e80950182771ec196dec6824fedf3728e0017f (diff)
Fix printing of -- marker when using -A as noted by gnezdo@
ok millert@
Diffstat (limited to 'usr.bin/grep')
-rw-r--r--usr.bin/grep/util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c
index e16d08e7d85..bcef0897881 100644
--- a/usr.bin/grep/util.c
+++ b/usr.bin/grep/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.63 2020/07/23 20:19:27 martijn Exp $ */
+/* $OpenBSD: util.c,v 1.64 2021/12/28 16:27:53 otto Exp $ */
/*-
* Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
@@ -258,8 +258,8 @@ print:
if ((tail > 0 || c) && !cflag && !qflag) {
if (c) {
- if (first > 0 && tail == 0 && (Bflag < linesqueued) &&
- (Aflag || Bflag))
+ if (first > 0 && tail == 0 && (Aflag || (Bflag &&
+ Bflag < linesqueued)))
printf("--\n");
first = 1;
tail = Aflag;