=================================================================== RCS file: /cvs/mandoc/man_term.c,v retrieving revision 1.190 retrieving revision 1.194 diff -u -p -r1.190 -r1.194 --- mandoc/man_term.c 2017/02/11 21:49:50 1.190 +++ mandoc/man_term.c 2017/05/04 22:16:09 1.194 @@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.190 2017/02/11 21:49:50 schwarze Exp $ */ +/* $Id: man_term.c,v 1.194 2017/05/04 22:16:09 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2015, 2017 Ingo Schwarze @@ -95,8 +95,7 @@ static void post_SS(DECL_ARGS); static void post_TP(DECL_ARGS); static void post_UR(DECL_ARGS); -static const struct termact termacts[MAN_MAX] = { - { pre_sp, NULL, MAN_NOTEXT }, /* br */ +static const struct termact __termacts[MAN_MAX - MAN_TH] = { { NULL, NULL, 0 }, /* TH */ { pre_SH, post_SH, 0 }, /* SH */ { pre_SS, post_SS, 0 }, /* SS */ @@ -135,6 +134,7 @@ static const struct termact termacts[MAN_MAX] = { { NULL, NULL, 0 }, /* UE */ { pre_ll, NULL, MAN_NOTEXT }, /* ll */ }; +static const struct termact *termacts = __termacts - MAN_TH; void @@ -457,9 +457,7 @@ pre_sp(DECL_ARGS) } } - if (n->tok == MAN_br) - len = 0; - else if (n->child == NULL) + if (n->child == NULL) len = 1; else { if ( ! a2roffsu(n->child->string, &su, SCALE_VS)) @@ -822,7 +820,7 @@ pre_SH(DECL_ARGS) do { n = n->prev; - } while (n != NULL && n->tok < MAN_MAX && + } while (n != NULL && n->tok != TOKEN_NONE && termacts[n->tok].flags & MAN_NOTEXT); if (n == NULL || (n->tok == MAN_SH && n->body->child == NULL)) break; @@ -986,6 +984,12 @@ print_man_node(DECL_ARGS) break; } + if (n->tok < ROFF_MAX) { + roff_term_pre(p, n); + return; + } + + assert(n->tok >= MAN_TH && n->tok <= MAN_MAX); if ( ! (MAN_NOTEXT & termacts[n->tok].flags)) term_fontrepl(p, TERMFONT_NONE);