summaryrefslogtreecommitdiff
path: root/regress/usr.bin/mandoc/mdoc/Os
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2014-11-21 01:52:46 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2014-11-21 01:52:46 +0000
commitf9c5aa7d69d88925112dd90b779add4bc63ba3df (patch)
treea5920212e1a96269a7d30be129b4bff01199a9bd /regress/usr.bin/mandoc/mdoc/Os
parent422a96a9ad6a4ffd61a706d7847f96526bfdcdd3 (diff)
We repeatedly observed assertion crashes in the low-level terminal
output handler because the high level terminal formatters could be tricked into setting the left margin further to the right than the right margin. Today, jsg@ found more of these with afl. Change the internal interface between both levels, aiming for simplicity and robustness of the code. Treat both margins as *independent* settings: Now, termp.offset is the requested left margin, and termp.rmargin is the available space. Let the lower level cope with that case of insufficient space. Obviously, high level code that does centering or flush right still has to do careful checks, so i did a full audit of margin settings in the terminal formatters. Fixes crashes caused by excessively long title or date strings in the man(7) footer, operating system or date strings in the mdoc(7) footer, volume strings in the man(7) or mdoc(7) header, and a few cases related to some non-prologue macros.
Diffstat (limited to 'regress/usr.bin/mandoc/mdoc/Os')
-rw-r--r--regress/usr.bin/mandoc/mdoc/Os/Makefile5
-rw-r--r--regress/usr.bin/mandoc/mdoc/Os/long.in8
-rw-r--r--regress/usr.bin/mandoc/mdoc/Os/long.out_ascii11
3 files changed, 22 insertions, 2 deletions
diff --git a/regress/usr.bin/mandoc/mdoc/Os/Makefile b/regress/usr.bin/mandoc/mdoc/Os/Makefile
index 7dd662c48f6..d228b09d1f7 100644
--- a/regress/usr.bin/mandoc/mdoc/Os/Makefile
+++ b/regress/usr.bin/mandoc/mdoc/Os/Makefile
@@ -1,6 +1,7 @@
-# $OpenBSD: Makefile,v 1.1 2014/08/14 02:00:53 schwarze Exp $
+# $OpenBSD: Makefile,v 1.2 2014/11/21 01:52:45 schwarze Exp $
-REGRESS_TARGETS = dupe late missing
+REGRESS_TARGETS = dupe late long missing
LINT_TARGETS = dupe late missing
+SKIP_GROFF = long
.include <bsd.regress.mk>
diff --git a/regress/usr.bin/mandoc/mdoc/Os/long.in b/regress/usr.bin/mandoc/mdoc/Os/long.in
new file mode 100644
index 00000000000..c4998629cbb
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Os/long.in
@@ -0,0 +1,8 @@
+.Dd November 20, 2014
+.Dt OS-LONG 1
+.Os 1234567890123456789012345678901234567890123456789012345678901234567890123456789
+.Sh NAME
+.Nm Os-long
+.Nd long operating system string
+.Sh DESCRIPTION
+some text
diff --git a/regress/usr.bin/mandoc/mdoc/Os/long.out_ascii b/regress/usr.bin/mandoc/mdoc/Os/long.out_ascii
new file mode 100644
index 00000000000..9253e13e097
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Os/long.out_ascii
@@ -0,0 +1,11 @@
+OS-LONG(1) General Commands Manual OS-LONG(1)
+
+NNAAMMEE
+ OOss--lloonngg - long operating system string
+
+DDEESSCCRRIIPPTTIIOONN
+ some text
+
+1234567890123456789012345678901234567890123456789012345678901234567890123456789
+ November 20, 2014
+1234567890123456789012345678901234567890123456789012345678901234567890123456789