summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2012-05-27 14:35:41 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2012-05-27 14:35:41 +0000
commit7533778ae885fdc011ff8b91ba500d1cc0f447b8 (patch)
tree93fb0919741cd1ebdebe5697c4742af8179b9d30
parent54d101cc489130b36069c6585063b205e9d300e8 (diff)
Make sure a nasty bug reported by naddy@ on July 3, 2011
never comes back (of course, it was fixed since then).
-rw-r--r--regress/usr.bin/mandoc/roff/cond/Makefile4
-rw-r--r--regress/usr.bin/mandoc/roff/cond/before-Dd.in30
-rw-r--r--regress/usr.bin/mandoc/roff/cond/before-Dd.out_ascii17
3 files changed, 49 insertions, 2 deletions
diff --git a/regress/usr.bin/mandoc/roff/cond/Makefile b/regress/usr.bin/mandoc/roff/cond/Makefile
index 2a778f4ab17..600e989078e 100644
--- a/regress/usr.bin/mandoc/roff/cond/Makefile
+++ b/regress/usr.bin/mandoc/roff/cond/Makefile
@@ -1,5 +1,5 @@
-# $OpenBSD: Makefile,v 1.1 2010/04/25 17:35:31 schwarze Exp $
+# $OpenBSD: Makefile,v 1.2 2012/05/27 14:35:40 schwarze Exp $
-REGRESS_TARGETS=if ie
+REGRESS_TARGETS=if ie before-Dd
.include <bsd.regress.mk>
diff --git a/regress/usr.bin/mandoc/roff/cond/before-Dd.in b/regress/usr.bin/mandoc/roff/cond/before-Dd.in
new file mode 100644
index 00000000000..6701403b322
--- /dev/null
+++ b/regress/usr.bin/mandoc/roff/cond/before-Dd.in
@@ -0,0 +1,30 @@
+.if n \{.ds mystring mytext
+.\}
+.Dd May 27, 2012
+.Dt IF-BEFORE-DD 1
+.Os OpenBSD
+.Sh NAME
+.Nm if-before-Dd
+.Nd end of if block on its own line before Dd
+.Sh DESCRIPTION
+In an old version of
+.Xr mandoc 1 ,
+.Xr mdoc 7
+file format autodetection failed when the end of an
+.Ic if
+block stood on its own line before the initial
+.Xr mdoc 7
+.Ic Dd
+macro.
+The file was mishandled as
+.Xr man 7
+and parsing failed with unknown macro errors.
+.Pp
+If the present document looks like a proper
+.Xr mdoc 7
+document and the following display reads
+.Dq mytext ,
+then the problem did not come back:
+.Bd -ragged -offset indent
+\*[mystring]
+.Ed
diff --git a/regress/usr.bin/mandoc/roff/cond/before-Dd.out_ascii b/regress/usr.bin/mandoc/roff/cond/before-Dd.out_ascii
new file mode 100644
index 00000000000..99845dae49e
--- /dev/null
+++ b/regress/usr.bin/mandoc/roff/cond/before-Dd.out_ascii
@@ -0,0 +1,17 @@
+IF-BEFORE-DD(1) OpenBSD Reference Manual IF-BEFORE-DD(1)
+
+NNAAMMEE
+ iiff--bbeeffoorree--DDdd - end of if block on its own line before Dd
+
+DDEESSCCRRIIPPTTIIOONN
+ In an old version of mandoc(1), mdoc(7) file format autodetection failed
+ when the end of an iiff block stood on its own line before the initial
+ mdoc(7) DDdd macro. The file was mishandled as man(7) and parsing failed
+ with unknown macro errors.
+
+ If the present document looks like a proper mdoc(7) document and the
+ following display reads ``mytext'', then the problem did not come back:
+
+ mytext
+
+OpenBSD May 27, 2012 OpenBSD