diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-11-16 21:29:35 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-11-16 21:29:35 +0000 |
commit | 4fab3c6e074ed129fedec660b155817a528496d3 (patch) | |
tree | 8dbb7ee117e89ac87deadbb7d089193091172839 /term.c | |
parent | b2253f6c44188be3e46ed120c93ead8a4cf3d140 (diff) | |
download | mandoc-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.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; |