=================================================================== RCS file: /cvs/mandoc/mdoc_term.c,v retrieving revision 1.210 retrieving revision 1.211 diff -u -p -r1.210 -r1.211 --- mandoc/mdoc_term.c 2011/01/25 10:37:49 1.210 +++ mandoc/mdoc_term.c 2011/01/25 15:17:18 1.211 @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.210 2011/01/25 10:37:49 kristaps Exp $ */ +/* $Id: mdoc_term.c,v 1.211 2011/01/25 15:17:18 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 */ @@ -1674,13 +1674,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); }