summaryrefslogtreecommitdiffstats
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
commitc788f866d218b1363d95abee27eec8df64a79179 (patch)
treec358e4f772b3db9924cf9048edd02b5be1288702 /term.c
parent1b7e684476a5dce00e6c6290fdd17c25e38d1e22 (diff)
downloadmandoc-c788f866d218b1363d95abee27eec8df64a79179.tar.gz
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.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/term.c b/term.c
index 37fb1fa9..1e1ea8fc 100644
--- a/term.c
+++ b/term.c
@@ -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++)