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@
-/* $Id: man_term.c,v 1.74 2010/06/09 08:07:13 kristaps Exp $ */
+/* $Id: man_term.c,v 1.75 2010/06/10 23:24:37 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
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) {
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;
-/* $Id: mdoc_term.c,v 1.145 2010/06/09 08:07:13 kristaps Exp $ */
+/* $Id: mdoc_term.c,v 1.146 2010/06/10 23:24:37 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
p->maxrmargin = p->defrmargin;
p->tabwidth = 5;
- term_begin(p, print_mdoc_head,
- print_mdoc_foot, mdoc_meta(mdoc));
-
if (NULL == p->symtab)
switch (p->enc) {
case (TERMENC_ASCII):
n = mdoc_node(mdoc);
m = mdoc_meta(mdoc);
+ term_begin(p, print_mdoc_head, print_mdoc_foot, m);
+
if (n->child)
print_mdoc_nodelist(p, NULL, m, n->child);