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_term.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'mdoc_term.c') 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 * Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze @@ -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); } -- cgit v1.2.3-56-ge451