diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2010-08-20 23:22:09 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2010-08-20 23:22:09 +0000 |
commit | d34d29a6e166f6fdc775dd433c5bc56281628597 (patch) | |
tree | c51b7810cfce6943b841a9698cee31d39f12f2e7 | |
parent | 1a3bd1cb27795956ca71c666968330b81362d013 (diff) | |
download | mandoc-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@.
-rw-r--r-- | term.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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; |