summaryrefslogtreecommitdiffstats
path: root/term.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-10-10 11:05:23 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-10-10 11:05:23 +0000
commit3dd53e4cb80fd56800af2570b55975d91b4d4c06 (patch)
tree4ad33b89cd5ac761969eef1bc3157d50a1d87bb5 /term.c
parent0c97c0b66cc60a6e458173cbaf79405d051f920e (diff)
downloadmandoc-3dd53e4cb80fd56800af2570b55975d91b4d4c06.tar.gz
Fix hang lists in -Tascii -Tmdoc, which seem to have been broken since ~1.8.x.
Noted similarity of HP/TP and -hang/-tag in mandoc.1.
Diffstat (limited to 'term.c')
-rw-r--r--term.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/term.c b/term.c
index 2392a621..91638e25 100644
--- a/term.c
+++ b/term.c
@@ -159,7 +159,7 @@ void
term_flushln(struct termp *p)
{
int i, j;
- size_t vbl, vsz, vis, maxvis, mmax, bp;
+ size_t vbl, vsz, vis, maxvis, mmax, bp, os;
static int overstep = 0;
/*
@@ -172,6 +172,9 @@ term_flushln(struct termp *p)
assert(p->offset < p->rmargin);
assert((int)(p->rmargin - p->offset) - overstep > 0);
+ /* Save the overstep. */
+ os = (size_t)overstep;
+
maxvis = /* LINTED */
p->rmargin - p->offset - overstep;
mmax = /* LINTED */
@@ -233,6 +236,9 @@ term_flushln(struct termp *p)
putchar(' ');
vis = 0;
}
+ /* Remove the overstep width. */
+ bp += os;
+ os = 0;
} else {
for (j = 0; j < (int)vbl; j++)
putchar(' ');