summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2010-08-20 23:22:09 +0000
committerIngo Schwarze <schwarze@openbsd.org>2010-08-20 23:22:09 +0000
commit46df402950b28191cf436117d4ec8cbf981a4a75 (patch)
tree77635f470328a72b8e67de763a3d43ea453dd4b8
parentffbd731dc451c848b76e3a18e38fd28e9f34e6b7 (diff)
downloadmandoc-46df402950b28191cf436117d4ec8cbf981a4a75.tar.gz
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@.
-rw-r--r--term.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/term.c b/term.c
index 957193e8..eb8eee83 100644
--- a/term.c
+++ b/term.c
@@ -275,6 +275,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;