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 | fdc95e0f088e210664eb7459003c922102fc748e (patch) | |
tree | 2941a73b51965c3192f9e63b7579762c3e8c0ad5 /mdoc_man.c | |
parent | e98d951b402f5f61bf0fafc86ae5ad5a03f1c85e (diff) | |
download | mandoc-fdc95e0f088e210664eb7459003c922102fc748e.tar.gz |
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_man.c')
-rw-r--r-- | mdoc_man.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -1565,11 +1565,16 @@ static int pre_sm(DECL_ARGS) { - assert(n->child && MDOC_TEXT == n->child->type); - if (0 == strcmp("on", n->child->string)) - outflags |= MMAN_Sm | MMAN_spc; + if (NULL == n->child) + outflags ^= MMAN_Sm; + else if (0 == strcmp("on", n->child->string)) + outflags |= MMAN_Sm; else outflags &= ~MMAN_Sm; + + if (MMAN_Sm & outflags) + outflags |= MMAN_spc; + return(0); } |