diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-07-02 19:55:10 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-07-02 19:55:10 +0000 |
commit | 01c92e6ac259f38d13175f7f9d76233713fff535 (patch) | |
tree | 1fc1a664a9171de99efb910f3ae460232a01c8a9 /mdoc_term.c | |
parent | 3eba010f0f31a85978d61e0b11e8da1c4933dac5 (diff) | |
download | mandoc-01c92e6ac259f38d13175f7f9d76233713fff535.tar.gz mandoc-01c92e6ac259f38d13175f7f9d76233713fff535.tar.zst mandoc-01c92e6ac259f38d13175f7f9d76233713fff535.zip |
When .Sm is called without an argument, groff toggles the spacing mode,
so let us do the same for compatibility. Using this feature is of
course not recommended except in manual page obfuscation contests.
Diffstat (limited to 'mdoc_term.c')
-rw-r--r-- | mdoc_term.c | 14 |
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); } |