]> git.cameronkatri.com Git - mandoc.git/commitdiff
When a column contains trailing spaces, calculate the padding
authorIngo Schwarze <schwarze@openbsd.org>
Fri, 20 Aug 2010 23:22:09 +0000 (23:22 +0000)
committerIngo Schwarze <schwarze@openbsd.org>
Fri, 20 Aug 2010 23:22:09 +0000 (23:22 +0000)
to the start of the next column correctly.
Fixing a problem found by jmc@ in sysctl(3), reminded by kettenis@.

term.c

diff --git a/term.c b/term.c
index 41c6c65556bbec0aed4135fb4287a407a181a07f..c2bcd15818e20e9cf73dbd50e3edf27d45620311 100644 (file)
--- 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;