aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/term.c
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
commitd34d29a6e166f6fdc775dd433c5bc56281628597 (patch)
treec51b7810cfce6943b841a9698cee31d39f12f2e7 /term.c
parent1a3bd1cb27795956ca71c666968330b81362d013 (diff)
downloadmandoc-d34d29a6e166f6fdc775dd433c5bc56281628597.tar.gz
mandoc-d34d29a6e166f6fdc775dd433c5bc56281628597.tar.zst
mandoc-d34d29a6e166f6fdc775dd433c5bc56281628597.zip
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 'term.c')
-rw-r--r--term.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/term.c b/term.c
index 41c6c655..c2bcd158 100644
--- a/term.c
+++ b/term.c
@@ -1,4 +1,4 @@
-/* $Id: term.c,v 1.167 2010/08/20 01:02:07 schwarze Exp $ */
+/* $Id: term.c,v 1.168 2010/08/20 23:22:09 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -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;