summaryrefslogtreecommitdiff
path: root/regress/usr.bin/mandoc
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2015-02-02 04:04:19 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2015-02-02 04:04:19 +0000
commitefb91b04446b2f00743c689c7593fccd67bfbfc0 (patch)
treed3b35c3789b2dcd7c9aaf7b918a923ae5ca5a35b /regress/usr.bin/mandoc
parent22ed797652f4377ed42c70a8bc2909aab8209154 (diff)
When a full block macro gets closed out by a mismatching
block closure macro it calls, do not attempt to open its body. This can for example happen for (nonsensical) constructions like .Fo .Nm Fc in the SYNOPSIS. Fixing an assertion failure jsg@ found with afl some time ago (test case number 731).
Diffstat (limited to 'regress/usr.bin/mandoc')
-rw-r--r--regress/usr.bin/mandoc/mdoc/Nm/Makefile21
-rw-r--r--regress/usr.bin/mandoc/mdoc/Nm/broken.in10
-rw-r--r--regress/usr.bin/mandoc/mdoc/Nm/broken.out_ascii11
3 files changed, 34 insertions, 8 deletions
diff --git a/regress/usr.bin/mandoc/mdoc/Nm/Makefile b/regress/usr.bin/mandoc/mdoc/Nm/Makefile
index 46ef3db412a..d575de0285a 100644
--- a/regress/usr.bin/mandoc/mdoc/Nm/Makefile
+++ b/regress/usr.bin/mandoc/mdoc/Nm/Makefile
@@ -1,18 +1,23 @@
-# $OpenBSD: Makefile,v 1.10 2014/08/21 12:56:24 schwarze Exp $
+# $OpenBSD: Makefile,v 1.11 2015/02/02 04:04:18 schwarze Exp $
-REGRESS_TARGETS = badNAME badNAMEuse break empty emptyNAME emptyNAMEuse
+REGRESS_TARGETS = badNAME badNAMEuse break broken
+REGRESS_TARGETS += empty emptyNAME emptyNAMEuse
REGRESS_TARGETS += font long punct
LINT_TARGETS = badNAME badNAMEuse break
-# groff-1.22.2/mandoc difference:
-# When the first Nm does not have an argument but a later one has,
-# mandoc retroactively uses the later name for the earlier instances
-# of Nm, too, while groff does not.
+# groff-1.22.3/mandoc differences:
+# - When the first Nm does not have an argument but a later one has,
+# mandoc retroactively uses the later name for the earlier instances
+# of Nm, too, while groff does not.
+# - When the head of an Nm block in the SYNOPSIS is broken by an
+# explicit block end macro on the same line, formatting differs,
+# but doesn't make sense either way.
-SKIP_GROFF = badNAMEuse emptyNAMEuse
+SKIP_GROFF = badNAMEuse emptyNAMEuse broken
+SKIP_TMAN = broken SILENT
-# groff-1.22.2 defect:
+# groff-1.22.3 defect:
# When a SYNOPSIS Nm block head breaks a sub block, all the
# remaining content in the document gets lost.
diff --git a/regress/usr.bin/mandoc/mdoc/Nm/broken.in b/regress/usr.bin/mandoc/mdoc/Nm/broken.in
new file mode 100644
index 00000000000..58a28bad85d
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Nm/broken.in
@@ -0,0 +1,10 @@
+.Dd February 2, 2015
+.Dt NM-BROKEN 1
+.Os OpenBSD
+.Sh NAME
+.Nm Nm-broken
+.Nd broken synapsis name block
+.Sh SYNOPSIS
+.Ft int
+.Fo function
+.Nm name Fc tail
diff --git a/regress/usr.bin/mandoc/mdoc/Nm/broken.out_ascii b/regress/usr.bin/mandoc/mdoc/Nm/broken.out_ascii
new file mode 100644
index 00000000000..1f9ed5a29be
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Nm/broken.out_ascii
@@ -0,0 +1,11 @@
+NM-BROKEN(1) General Commands Manual NM-BROKEN(1)
+
+NNAAMMEE
+ NNmm--bbrrookkeenn - broken synapsis name block
+
+SSYYNNOOPPSSIISS
+ _i_n_t
+ ffuunnccttiioonn(nnaammee);
+ tail
+
+OpenBSD February 2, 2015 OpenBSD