summaryrefslogtreecommitdiffstats
path: root/mdoc_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-03-06 13:09:07 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-03-06 13:09:07 +0000
commit266a26007c7adee2f5afdcf2daad4e88a6a28775 (patch)
tree435e255f72e9df0fe1223f813f6234edd8f97526 /mdoc_term.c
parent611e51a9591bc8bb08db2b843ed4e45b0e19567b (diff)
downloadmandoc-266a26007c7adee2f5afdcf2daad4e88a6a28775.tar.gz
In mdoc(7), don't mistreat negative .sp arguments as large positive ones.
Instead, use the same logic as for man(7).
Diffstat (limited to 'mdoc_term.c')
-rw-r--r--mdoc_term.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index 17ab4cdf..33591c38 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -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);
}