diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-03-06 13:09:07 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-03-06 13:09:07 +0000 |
commit | a46a5eca6f395c86f507c20f47ab147378f70f00 (patch) | |
tree | cd8d3b6eb33158bcee2cb150a00cf12bd247b947 | |
parent | f83be2421ca3ee7da00b28231d211a98a3a628ed (diff) | |
download | mandoc-a46a5eca6f395c86f507c20f47ab147378f70f00.tar.gz mandoc-a46a5eca6f395c86f507c20f47ab147378f70f00.tar.zst mandoc-a46a5eca6f395c86f507c20f47ab147378f70f00.zip |
In mdoc(7), don't mistreat negative .sp arguments as large positive ones.
Instead, use the same logic as for man(7).
-rw-r--r-- | mdoc_term.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/mdoc_term.c b/mdoc_term.c index cc44d761..acba3829 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.311 2015/02/17 20:37:17 schwarze Exp $ */ +/* $Id: mdoc_term.c,v 1.312 2015/03/06 13:09:07 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2012-2015 Ingo Schwarze <schwarze@openbsd.org> @@ -1808,7 +1808,7 @@ static int termp_sp_pre(DECL_ARGS) { struct roffsu su; - size_t i, len; + int i, len; switch (n->tok) { case MDOC_sp: @@ -1829,8 +1829,11 @@ termp_sp_pre(DECL_ARGS) if (0 == len) term_newln(p); - for (i = 0; i < len; i++) - term_vspace(p); + else if (len < 0) + p->skipvsp -= len; + else + for (i = 0; i < len; i++) + term_vspace(p); return(0); } |