summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/man_term.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2018-06-10 15:12:32 +0000
committerschwarze <schwarze@openbsd.org>2018-06-10 15:12:32 +0000
commit4d699dd2576d72edd88554cbf9d4150e73ff91dd (patch)
tree230536f3be931428d4554ca6b66d2418d9123726 /usr.bin/mandoc/man_term.c
parentPut the register-saving parts of INTRENTRY() into their own macros for (diff)
downloadwireguard-openbsd-4d699dd2576d72edd88554cbf9d4150e73ff91dd.tar.xz
wireguard-openbsd-4d699dd2576d72edd88554cbf9d4150e73ff91dd.zip
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/mandoc/man_term.c')
-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);
}