=================================================================== RCS file: /cvs/mandoc/term.c,v retrieving revision 1.76 retrieving revision 1.78 diff -u -p -r1.76 -r1.78 --- mandoc/term.c 2009/06/11 07:26:35 1.76 +++ mandoc/term.c 2009/06/11 10:34:32 1.78 @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.76 2009/06/11 07:26:35 kristaps Exp $ */ +/* $Id: term.c,v 1.78 2009/06/11 10:34:32 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -272,22 +272,20 @@ 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++) + putchar(' '); + for ( ; i < (int)p->col; i++) { if (' ' == p->buf[i]) break; putchar(p->buf[i]); } vis += vsz; - if (i < (int)p->col && vis <= bp) { - putchar(' '); - vis++; - } } /* @@ -295,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++) @@ -312,7 +310,7 @@ term_flushln(struct termp *p) if (p->flags & TERMP_NOBREAK) { if ( ! (TERMP_NONOBREAK & p->flags)) - for ( ; vis < maxvis; vis++) + for ( ; vis <= maxvis; vis++) putchar(' '); } else putchar('\n');