aboutsummaryrefslogtreecommitdiffstatshomepage
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
commitd78af72a5fc16f78890e7b519b7b1b5da7aabd39 (patch)
treefb82fe3d26d3f452c55faf4d6a326778c2f44e08 /mdoc_term.c
parent7d4de02dd6695c84d1787692b20b6a2d9942a67d (diff)
downloadmandoc-d78af72a5fc16f78890e7b519b7b1b5da7aabd39.tar.gz
mandoc-d78af72a5fc16f78890e7b519b7b1b5da7aabd39.tar.zst
mandoc-d78af72a5fc16f78890e7b519b7b1b5da7aabd39.zip
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.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index 91954258..169b2b4b 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -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 <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -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);
}