summaryrefslogtreecommitdiffstats
path: root/mdoc_term.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-01-30 08:42:20 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-01-30 08:42:20 +0000
commit544544185bcee3b5efb8ee4ccd6c444ea8fef690 (patch)
tree08cf8012b075ef18f97cccc9904280cf451a2b9f /mdoc_term.c
parent69596003d5d304964e0f7f88ac7d957b18ecf9ca (diff)
downloadmandoc-544544185bcee3b5efb8ee4ccd6c444ea8fef690.tar.gz
Fix in handling Vt in SYNOPSIS with trailing punctuation. Spotted by Joerg Sonnenberger.
Diffstat (limited to 'mdoc_term.c')
-rw-r--r--mdoc_term.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index b850b8e1..ee1967bc 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -132,6 +132,7 @@ static int termp_sq_pre(DECL_ARGS);
static int termp_ss_pre(DECL_ARGS);
static int termp_under_pre(DECL_ARGS);
static int termp_ud_pre(DECL_ARGS);
+static int termp_vt_pre(DECL_ARGS);
static int termp_xr_pre(DECL_ARGS);
static int termp_xx_pre(DECL_ARGS);
@@ -175,7 +176,7 @@ static const struct termact termacts[MDOC_MAX] = {
{ termp_rv_pre, NULL }, /* Rv */
{ NULL, NULL }, /* St */
{ termp_under_pre, NULL }, /* Va */
- { termp_under_pre, termp_vt_post }, /* Vt */
+ { termp_vt_pre, termp_vt_post }, /* Vt */
{ termp_xr_pre, NULL }, /* Xr */
{ NULL, termp____post }, /* %A */
{ termp_under_pre, termp____post }, /* %B */
@@ -1290,12 +1291,27 @@ termp_xr_pre(DECL_ARGS)
}
+static int
+termp_vt_pre(DECL_ARGS)
+{
+
+ if (MDOC_ELEM == n->type)
+ return(termp_under_pre(p, pair, m, n));
+ else if (MDOC_HEAD == n->type)
+ return(0);
+ else if (MDOC_BLOCK == n->type)
+ return(1);
+
+ return(termp_under_pre(p, pair, m, n));
+}
+
+
/* ARGSUSED */
static void
termp_vt_post(DECL_ARGS)
{
- if (n->sec != SEC_SYNOPSIS)
+ if (MDOC_BLOCK != n->type)
return;
if (n->next && MDOC_Vt == n->next->tok)
term_newln(p);