From d34d29a6e166f6fdc775dd433c5bc56281628597 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 20 Aug 2010 23:22:09 +0000 Subject: 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@. --- term.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'term.c') 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 * Copyright (c) 2010 Ingo Schwarze @@ -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; -- cgit v1.2.3-56-ge451