summaryrefslogtreecommitdiffstats
path: root/man_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2010-06-10 23:24:37 +0000
committerIngo Schwarze <schwarze@openbsd.org>2010-06-10 23:24:37 +0000
commit54c0fe4b66b6f28b69d70293f915b255af598960 (patch)
tree098fa67561a5cf2eec5708b6ee89bf1f881648fe /man_term.c
parent92fc4a31da7eb79879434d883684209266ac3ff2 (diff)
downloadmandoc-54c0fe4b66b6f28b69d70293f915b255af598960.tar.gz
Fix a regression that crept in in man_term.c 1.73 and mdoc_term.c 1.144.
When the title line uses special characters, mandoc will segfault. Thus, first set up the character tables, then print the header, as we always did. Found in OpenBSD /usr/src/usr.sbin/bind/bin/check/named-checkconf.8. While here, set p->tabwidth in terminal_man() for symmetry with terminal_mdoc(), as suggested by millert@ (and already committed to OpenBSD earlier). Since 5 is the default, this is not strictly required, but it is certainly clearer and more robust. "looks fine" kristaps@
Diffstat (limited to 'man_term.c')
-rw-r--r--man_term.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/man_term.c b/man_term.c
index e1fc9ac9..143a38dc 100644
--- a/man_term.c
+++ b/man_term.c
@@ -158,8 +158,7 @@ terminal_man(void *arg, const struct man *man)
p->overstep = 0;
p->maxrmargin = p->defrmargin;
-
- term_begin(p, print_man_head, print_man_foot, man_meta(man));
+ p->tabwidth = 5;
if (NULL == p->symtab)
switch (p->enc) {
@@ -174,6 +173,7 @@ terminal_man(void *arg, const struct man *man)
n = man_node(man);
m = man_meta(man);
+ term_begin(p, print_man_head, print_man_foot, m);
p->flags |= TERMP_NOSPACE;
mt.fl = 0;