From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (schwarze@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id o5ANObwW022023 for ; Thu, 10 Jun 2010 19:24:37 -0400 (EDT) Received: (from schwarze@localhost) by krisdoz.my.domain (8.14.3/8.14.3/Submit) id o5ANObGm012243; Thu, 10 Jun 2010 19:24:37 -0400 (EDT) Date: Thu, 10 Jun 2010 19:24:37 -0400 (EDT) Message-Id: <201006102324.o5ANObGm012243@krisdoz.my.domain> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: Fix a regression that crept in in man_term.c 1.73 and X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- 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@ Modified Files: -------------- mdocml: man_term.c mdoc_term.c Revision Data ------------- Index: man_term.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man_term.c,v retrieving revision 1.74 retrieving revision 1.75 diff -Lman_term.c -Lman_term.c -u -p -r1.74 -r1.75 --- man_term.c +++ man_term.c @@ -158,8 +158,7 @@ terminal_man(void *arg, const struct 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 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; Index: mdoc_term.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_term.c,v retrieving revision 1.145 retrieving revision 1.146 diff -Lmdoc_term.c -Lmdoc_term.c -u -p -r1.145 -r1.146 --- mdoc_term.c +++ mdoc_term.c @@ -276,9 +276,6 @@ terminal_mdoc(void *arg, const struct md 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): @@ -291,6 +288,8 @@ terminal_mdoc(void *arg, const struct md 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); -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv