diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2010-08-20 23:22:08 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2010-08-20 23:22:08 +0000 |
commit | 0d03f3eb060bde2ef50b58aba19d6dfc7852da4e (patch) | |
tree | 535dc9ce06df509b7e5bc9a6abe530f41775a9a9 /usr.bin/mandoc | |
parent | c1db5b0ccbbb54f8752836e6c3ea8690f79d7733 (diff) |
When a column contains trailing spaces, calculate the padding
to the start of the next column correctly.
Fixing a problem found by jmc@ in sysctl(3), reminded by kettenis@.
Diffstat (limited to 'usr.bin/mandoc')
-rw-r--r-- | usr.bin/mandoc/term.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.bin/mandoc/term.c b/usr.bin/mandoc/term.c index 56463d59f0f..8a88309dfe4 100644 --- a/usr.bin/mandoc/term.c +++ b/usr.bin/mandoc/term.c @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.47 2010/08/20 00:53:35 schwarze Exp $ */ +/* $Id: term.c,v 1.48 2010/08/20 23:22:07 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org> @@ -271,6 +271,12 @@ term_flushln(struct termp *p) vis = vend; } + /* + * If there was trailing white space, it was not printed; + * so reset the cursor position accordingly. + */ + vis -= vbl; + p->col = 0; p->overstep = 0; |