summaryrefslogtreecommitdiffstats
path: root/term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-11-16 21:29:35 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-11-16 21:29:35 +0000
commit4fab3c6e074ed129fedec660b155817a528496d3 (patch)
tree8dbb7ee117e89ac87deadbb7d089193091172839 /term.c
parentb2253f6c44188be3e46ed120c93ead8a4cf3d140 (diff)
downloadmandoc-4fab3c6e074ed129fedec660b155817a528496d3.tar.gz
When a line (in the sense of term_flushln()) contains white space only,
the `vbl' variable includes the left margin, but `vis' does not. Prevent a `vis' underflow that caused a bogus blank line. Bug reported by Carsten Kunze, found in less(1): .Bl -tag ... .It " "
Diffstat (limited to 'term.c')
-rw-r--r--term.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/term.c b/term.c
index 25e0e0fd..42c7a5f8 100644
--- a/term.c
+++ b/term.c
@@ -254,8 +254,10 @@ term_flushln(struct termp *p)
* If there was trailing white space, it was not printed;
* so reset the cursor position accordingly.
*/
- if (vis)
+ if (vis > vbl)
vis -= vbl;
+ else
+ vis = 0;
p->col = 0;
p->overstep = 0;