=================================================================== RCS file: /cvs/mandoc/mdoc_man.c,v retrieving revision 1.104 retrieving revision 1.107 diff -u -p -r1.104 -r1.107 --- mandoc/mdoc_man.c 2017/02/17 19:15:41 1.104 +++ mandoc/mdoc_man.c 2017/04/17 12:53:29 1.107 @@ -1,4 +1,4 @@ -/* $Id: mdoc_man.c,v 1.104 2017/02/17 19:15:41 schwarze Exp $ */ +/* $Id: mdoc_man.c,v 1.107 2017/04/17 12:53:29 schwarze Exp $ */ /* * Copyright (c) 2011-2017 Ingo Schwarze * @@ -715,8 +715,7 @@ static int pre__t(DECL_ARGS) { - if (n->parent && MDOC_Rs == n->parent->tok && - n->parent->norm->Rs.quote_T) { + if (n->parent->tok == MDOC_Rs && n->parent->norm->Rs.quote_T) { print_word("\\(lq"); outflags &= ~MMAN_spc; } else @@ -728,8 +727,7 @@ static void post__t(DECL_ARGS) { - if (n->parent && MDOC_Rs == n->parent->tok && - n->parent->norm->Rs.quote_T) { + if (n->parent->tok == MDOC_Rs && n->parent->norm->Rs.quote_T) { outflags &= ~MMAN_spc; print_word("\\(rq"); } else @@ -1467,22 +1465,30 @@ pre_lk(DECL_ARGS) { const struct roff_node *link, *descr; - if (NULL == (link = n->child)) + if ((link = n->child) == NULL) return 0; - if (NULL != (descr = link->next)) { + /* Link text. */ + if ((descr = link->next) != NULL && !(descr->flags & NODE_DELIMC)) { font_push('I'); - while (NULL != descr) { + while (descr != NULL && !(descr->flags & NODE_DELIMC)) { print_word(descr->string); descr = descr->next; } - print_word(":"); font_pop(); + print_word(":"); } + /* Link target. */ font_push('B'); print_word(link->string); font_pop(); + + /* Trailing punctuation. */ + while (descr != NULL) { + print_word(descr->string); + descr = descr->next; + } return 0; }