From 01c92e6ac259f38d13175f7f9d76233713fff535 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Wed, 2 Jul 2014 19:55:10 +0000 Subject: 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. --- mdoc_man.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'mdoc_man.c') diff --git a/mdoc_man.c b/mdoc_man.c index 8dcfae74..b6362f46 100644 --- a/mdoc_man.c +++ b/mdoc_man.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_man.c,v 1.64 2014/07/02 03:48:07 schwarze Exp $ */ +/* $Id: mdoc_man.c,v 1.65 2014/07/02 19:55:10 schwarze Exp $ */ /* * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze * @@ -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); } -- cgit v1.2.3