summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2018-06-10 15:12:33 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2018-06-10 15:12:33 +0000
commit1b53b0de2413599aea0be469a0256bfffd9b7948 (patch)
tree7e89fcc0b7e1454694dc3200d2bce255f5b9918c /usr.bin
parent4aedd10d2b83fb301b4764418c95ccdc76bbc79b (diff)
When formatting man(7) documents that do not contain .SH macros
with -Tps or -Tpdf, do not squeeze the whole text beyond the right margin. Bug reported by Will Backman during BSDCan.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mandoc/man_term.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c
index 839230e10d5..aff828f1b3e 100644
--- a/usr.bin/mandoc/man_term.c
+++ b/usr.bin/mandoc/man_term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: man_term.c,v 1.163 2018/04/11 17:10:35 schwarze Exp $ */
+/* $OpenBSD: man_term.c,v 1.164 2018/06/10 15:12:32 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -1030,6 +1030,18 @@ print_man_foot(struct termp *p, const struct roff_meta *meta)
term_word(p, title);
term_flushln(p);
+
+ /*
+ * Reset the terminal state for more output after the footer:
+ * Some output modes, in particular PostScript and PDF, print
+ * the header and the footer into a buffer such that it can be
+ * reused for multiple output pages, then go on to format the
+ * main text.
+ */
+
+ p->tcol->offset = 0;
+ p->flags = 0;
+
free(title);
}