summaryrefslogtreecommitdiff
path: root/regress/usr.bin/mandoc/roff
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/roff
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/roff')
-rw-r--r--regress/usr.bin/mandoc/roff/scale/horiz.in4
-rw-r--r--regress/usr.bin/mandoc/roff/scale/horiz.out_ascii3
2 files changed, 5 insertions, 2 deletions
diff --git a/regress/usr.bin/mandoc/roff/scale/horiz.in b/regress/usr.bin/mandoc/roff/scale/horiz.in
index 89434db98b4..cd74e7ccfe6 100644
--- a/regress/usr.bin/mandoc/roff/scale/horiz.in
+++ b/regress/usr.bin/mandoc/roff/scale/horiz.in
@@ -1,4 +1,4 @@
-.TH HORIZ 1 "August 12, 2014" OpenBSD
+.TH HORIZ 1 "November 20, 2014" OpenBSD
.SH NAME
horiz \- horizontal distances
.SH DESCRIPTION
@@ -21,5 +21,7 @@ initial text
10n
.in 5m
5m
+.in 79n
+79n
.PP
final text
diff --git a/regress/usr.bin/mandoc/roff/scale/horiz.out_ascii b/regress/usr.bin/mandoc/roff/scale/horiz.out_ascii
index e138965ce94..5c7f1d5fbad 100644
--- a/regress/usr.bin/mandoc/roff/scale/horiz.out_ascii
+++ b/regress/usr.bin/mandoc/roff/scale/horiz.out_ascii
@@ -16,9 +16,10 @@ DDEESSCCRRIIPPTTIIOONN
36p
10n
5m
+ 79n
final text
-OpenBSD August 12, 2014 HORIZ(1)
+OpenBSD November 20, 2014 HORIZ(1)