summaryrefslogtreecommitdiffstatshomepage
path: root/term.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-06-11 10:34:31 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-06-11 10:34:31 +0000
commit7f83f64018902ad39b94705868df283386db95fa (patch)
tree5058a9231aafa949372278a09f5c82e1f4535922 /term.c
parent4e8530b25c1ddc46a8d4709c6f548e140bd0b27b (diff)
downloadmandoc-7f83f64018902ad39b94705868df283386db95fa.tar.gz
mandoc-7f83f64018902ad39b94705868df283386db95fa.tar.zst
mandoc-7f83f64018902ad39b94705868df283386db95fa.zip
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.
Diffstat (limited to 'term.c')
-rw-r--r--term.c11
1 files changed, 5 insertions, 6 deletions
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 <kristaps@kth.se>
*
@@ -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++)