summaryrefslogtreecommitdiffstats
path: root/term.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-06-11 07:46:41 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-06-11 07:46:41 +0000
commitf5fea7af3791272c2240400f3f9c999fa68588c5 (patch)
tree62fec6dec0f200665542ef799961a245b86fbed3 /term.c
parentf690e8836e76c3e77c127e546135ba106d53d2a7 (diff)
downloadmandoc-f5fea7af3791272c2240400f3f9c999fa68588c5.tar.gz
Fix space-before-newline (inspired by schwarze@openbsd.org).
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 bc161bbb..37fb1fa9 100644
--- a/term.c
+++ b/term.c
@@ -278,16 +278,15 @@ term_flushln(struct termp *p)
* our breakpoint.
*/
+ 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++;
- }
}
/*
@@ -312,7 +311,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');