summaryrefslogtreecommitdiffstats
path: root/mdoc_term.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-01-25 15:17:18 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-01-25 15:17:18 +0000
commit99f9e0ced799039092a15e576a2ba9f04fff9d0a (patch)
tree6ee3c1b0bef7f50ae8d988e0792388c48da9e5de /mdoc_term.c
parent7af39d09674498b502965c63cb5f54c73013e86b (diff)
downloadmandoc-99f9e0ced799039092a15e576a2ba9f04fff9d0a.tar.gz
Have `Bx' accept two arguments, not just one, and join these arguments
with "xxBSD-yy"
Diffstat (limited to 'mdoc_term.c')
-rw-r--r--mdoc_term.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index ee369f09..703f2d06 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -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");
+ } else {
+ term_word(p, "BSD");
+ return(0);
+ }
+
+ if (NULL != (n = n->next)) {
p->flags |= TERMP_NOSPACE;
- term_word(p, "BSD");
+ term_word(p, "-");
+ p->flags |= TERMP_NOSPACE;
+ term_word(p, n->string);
+ }
+
+ return(0);
}