From 194fdd32fe2e8d95e8130915d406a4509ac1caf7 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 16 Nov 2014 21:29:35 +0000 Subject: When a line (in the sense of term_flushln()) contains white space only, the `vbl' variable includes the left margin, but `vis' does not. Prevent a `vis' underflow that caused a bogus blank line. Bug reported by Carsten Kunze, found in less(1): .Bl -tag ... .It " " --- term.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/term.c b/term.c index dc30cca5..085d254b 100644 --- a/term.c +++ b/term.c @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.234 2014/11/01 04:03:49 schwarze Exp $ */ +/* $Id: term.c,v 1.235 2014/11/16 21:29:35 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze @@ -254,8 +254,10 @@ term_flushln(struct termp *p) * If there was trailing white space, it was not printed; * so reset the cursor position accordingly. */ - if (vis) + if (vis > vbl) vis -= vbl; + else + vis = 0; p->col = 0; p->overstep = 0; -- cgit v1.2.3-56-ge451