From 7f83f64018902ad39b94705868df283386db95fa Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Thu, 11 Jun 2009 10:34:31 +0000 Subject: Clean up validation of field widths. Pushed field-width warn/error into warn/error routine. Removed superfluous space at output eoln. Fixed overzealous line break in lists. --- term.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'term.c') diff --git a/term.c b/term.c index 814d90f8..3dabeffa 100644 --- a/term.c +++ b/term.c @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.77 2009/06/11 07:46:41 kristaps Exp $ */ +/* $Id: term.c,v 1.78 2009/06/11 10:34:32 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -272,10 +272,9 @@ term_flushln(struct termp *p) vis = p->rmargin - p->offset; } - /* - * Write out the word and a trailing space. Omit the - * space if we're the last word in the line or beyond - * our breakpoint. + /* + * Prepend a space if we're not already at the beginning + * of the line, then the word. */ if (0 < vis++) @@ -294,7 +293,7 @@ term_flushln(struct termp *p) * cause a newline and offset at the right margin. */ - if ((TERMP_NOBREAK & p->flags) && vis >= maxvis) { + if ((TERMP_NOBREAK & p->flags) && vis > maxvis) { if ( ! (TERMP_NONOBREAK & p->flags)) { putchar('\n'); for (i = 0; i < (int)p->rmargin; i++) -- cgit v1.2.3-56-ge451