aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_term.c
diff options
context:
space:
mode:
Diffstat (limited to 'mdoc_term.c')
-rw-r--r--mdoc_term.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index 0039525a..7a007e84 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.268 2014/07/02 03:48:07 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.269 2014/07/02 19:55:10 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -2056,14 +2056,16 @@ static int
termp_sm_pre(DECL_ARGS)
{
- assert(n->child && MDOC_TEXT == n->child->type);
- if (0 == strcmp("on", n->child->string)) {
- if (p->col)
- p->flags &= ~TERMP_NOSPACE;
+ if (NULL == n->child)
+ p->flags ^= TERMP_NONOSPACE;
+ else if (0 == strcmp("on", n->child->string))
p->flags &= ~TERMP_NONOSPACE;
- } else
+ else
p->flags |= TERMP_NONOSPACE;
+ if (p->col && ! (TERMP_NONOSPACE & p->flags))
+ p->flags &= ~TERMP_NOSPACE;
+
return(0);
}