=================================================================== RCS file: /cvs/mandoc/mdoc_term.c,v retrieving revision 1.209 retrieving revision 1.215 diff -u -p -r1.209 -r1.215 --- mandoc/mdoc_term.c 2011/01/12 10:43:22 1.209 +++ mandoc/mdoc_term.c 2011/02/02 21:40:45 1.215 @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.209 2011/01/12 10:43:22 kristaps Exp $ */ +/* $Id: mdoc_term.c,v 1.215 2011/02/02 21:40:45 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * Copyright (c) 2010 Ingo Schwarze @@ -73,7 +73,6 @@ static void termp_an_post(DECL_ARGS); static void termp_bd_post(DECL_ARGS); static void termp_bk_post(DECL_ARGS); static void termp_bl_post(DECL_ARGS); -static void termp_bx_post(DECL_ARGS); static void termp_d1_post(DECL_ARGS); static void termp_fo_post(DECL_ARGS); static void termp_in_post(DECL_ARGS); @@ -95,6 +94,7 @@ static int termp_bk_pre(DECL_ARGS); static int termp_bl_pre(DECL_ARGS); static int termp_bold_pre(DECL_ARGS); static int termp_bt_pre(DECL_ARGS); +static int termp_bx_pre(DECL_ARGS); static int termp_cd_pre(DECL_ARGS); static int termp_d1_pre(DECL_ARGS); static int termp_ex_pre(DECL_ARGS); @@ -187,7 +187,7 @@ static const struct termact termacts[MDOC_MAX] = { { termp_quote_pre, termp_quote_post }, /* Bo */ { termp_quote_pre, termp_quote_post }, /* Bq */ { termp_xx_pre, NULL }, /* Bsx */ - { NULL, termp_bx_post }, /* Bx */ + { termp_bx_pre, NULL }, /* Bx */ { NULL, NULL }, /* Db */ { NULL, NULL }, /* Dc */ { termp_quote_pre, termp_quote_post }, /* Do */ @@ -1151,7 +1151,8 @@ static int termp_ns_pre(DECL_ARGS) { - p->flags |= TERMP_NOSPACE; + if ( ! (MDOC_LINE & n->flags)) + p->flags |= TERMP_NOSPACE; return(1); } @@ -1674,13 +1675,27 @@ termp_bd_post(DECL_ARGS) /* ARGSUSED */ -static void -termp_bx_post(DECL_ARGS) +static int +termp_bx_pre(DECL_ARGS) { - if (n->child) + if (NULL != (n = n->child)) { + term_word(p, n->string); p->flags |= TERMP_NOSPACE; - term_word(p, "BSD"); + term_word(p, "BSD"); + } else { + term_word(p, "BSD"); + return(0); + } + + if (NULL != (n = n->next)) { + p->flags |= TERMP_NOSPACE; + term_word(p, "-"); + p->flags |= TERMP_NOSPACE; + term_word(p, n->string); + } + + return(0); } @@ -1714,9 +1729,13 @@ termp_xx_pre(DECL_ARGS) break; } - assert(pp); term_word(p, pp); - return(1); + if (n->child) { + p->flags |= TERMP_KEEP; + term_word(p, n->child->string); + p->flags &= ~TERMP_KEEP; + } + return(0); } @@ -2169,7 +2188,7 @@ termp__t_post(DECL_ARGS) * us instead of underlining us (for disambiguation). */ if (n->parent && MDOC_Rs == n->parent->tok && - n->parent->norm->Rs.child_J) + n->parent->norm->Rs.quote_T) termp_quote_post(p, pair, m, n); termp____post(p, pair, m, n); @@ -2185,7 +2204,7 @@ termp__t_pre(DECL_ARGS) * us instead of underlining us (for disambiguation). */ if (n->parent && MDOC_Rs == n->parent->tok && - n->parent->norm->Rs.child_J) + n->parent->norm->Rs.quote_T) return(termp_quote_pre(p, pair, m, n)); term_fontpush(p, TERMFONT_UNDER);