So this is the complete diff, regress parts are from Stefan.
Asking for OK's. I'll commit the usr.bin and sys part and let Stefan
do the regress part.
-Otto
Index: usr.bin/grep/util.c
===================================================================
RCS file: /cvs/src/usr.bin/grep/util.c,v
retrieving revision 1.63
diff -u -p -r1.63 util.c
--- usr.bin/grep/util.c 23 Jul 2020 20:19:27 -0000 1.63
+++ usr.bin/grep/util.c 28 Dec 2021 10:07:00 -0000
@@ -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;
Index: sys/arch/amd64/conf/Makefile.amd64
===================================================================
RCS file: /cvs/src/sys/arch/amd64/conf/Makefile.amd64,v
retrieving revision 1.123
diff -u -p -r1.123 Makefile.amd64
--- sys/arch/amd64/conf/Makefile.amd64 17 Dec 2021 14:59:22 -0000 1.123
+++ sys/arch/amd64/conf/Makefile.amd64 28 Dec 2021 10:07:00 -0000
@@ -158,7 +158,8 @@ ioconf.o: ioconf.c
locore.o: assym.h
${NORMAL_S}
- @[[ -n `objdump -D $@ | grep -A1 doreti_iret | sort | uniq -d` ]] || \
+ @[[ -n `objdump -D $@ | grep -A1 doreti_iret | grep -v ^-- | sort | \
+ uniq -d` ]] || \
{ rm -f $@; echo "ERROR: overlaid iretq instructions don't line up"; \
echo "#GP-on-iretq fault handling would be broken"; exit 1; }
Index: regress/usr.bin/grep/Makefile
===================================================================
RCS file: /cvs/src/regress/usr.bin/grep/Makefile,v
retrieving revision 1.17
diff -u -p -r1.17 Makefile
--- regress/usr.bin/grep/Makefile 12 Dec 2012 15:11:25 -0000 1.17
+++ regress/usr.bin/grep/Makefile 28 Dec 2021 10:07:00 -0000
@@ -1,7 +1,7 @@
# $OpenBSD: Makefile,v 1.17 2012/12/12 15:11:25 weerd Exp $
REGRESS_TARGETS=t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 \
- t18 t19 t20 t21 t22 t23 t24 t25 t26
+ t18 t19 t20 t21 t22 t23 t24 t25 t26 t27
t1:
grep t.s ${.CURDIR}/in | diff - ${.CURDIR}/t1.out
@@ -102,8 +102,13 @@ t25:
t26:
echo 'aaab' | grep -o 'a*' | head -n 10 | diff - ${.CURDIR}/t26.out
+t27:
+ grep -A1 'C' ${.CURDIR}/t27.in | diff - ${.CURDIR}/t27a.out
+ grep -B1 'C' ${.CURDIR}/t27.in | diff - ${.CURDIR}/t27b.out
+ grep -C1 'C' ${.CURDIR}/t27.in | diff - ${.CURDIR}/t27c.out
+
.PHONY: t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20
-.PHONY: t21 t22 t23 t24 t25 t26
+.PHONY: t21 t22 t23 t24 t25 t26 t27
.include <bsd.regress.mk>
Index: regress/usr.bin/grep/t27.in
===================================================================
RCS file: regress/usr.bin/grep/t27.in
diff -N regress/usr.bin/grep/t27.in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ regress/usr.bin/grep/t27.in 28 Dec 2021 10:07:00 -0000
@@ -0,0 +1,12 @@
+A
+B
+C
+D
+A
+B
+C
+D
+A
+B
+C
+D
Index: regress/usr.bin/grep/t27a.out
===================================================================
RCS file: regress/usr.bin/grep/t27a.out
diff -N regress/usr.bin/grep/t27a.out
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ regress/usr.bin/grep/t27a.out 28 Dec 2021 10:07:00 -0000
@@ -0,0 +1,8 @@
+C
+D
+--
+C
+D
+--
+C
+D
Index: regress/usr.bin/grep/t27b.out
===================================================================
RCS file: regress/usr.bin/grep/t27b.out
diff -N regress/usr.bin/grep/t27b.out
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ regress/usr.bin/grep/t27b.out 28 Dec 2021 10:07:00 -0000
@@ -0,0 +1,8 @@
+B
+C
+--
+B
+C
+--
+B
+C
Index: regress/usr.bin/grep/t27c.out
===================================================================
RCS file: regress/usr.bin/grep/t27c.out
diff -N regress/usr.bin/grep/t27c.out
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ regress/usr.bin/grep/t27c.out 28 Dec 2021 10:07:00 -0000
@@ -0,0 +1,11 @@
+B
+C
+D
+--
+B
+C
+D
+--
+B
+C
+D