summaryrefslogtreecommitdiffstats
path: root/term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-12-24 23:32:42 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-12-24 23:32:42 +0000
commit4039dc9d2363717732db9e312b0dcc38973d1a54 (patch)
treee0732e3c42b57f0a92079aacdde4967354c83e24 /term.c
parent87b33207281eab1594f4681af9e74ecdc86df0ba (diff)
downloadmandoc-4039dc9d2363717732db9e312b0dcc38973d1a54.tar.gz
Support negative indentations for mdoc(7) displays and lists.
Not exactly recommended for use, rather for groff compatibility. While here, introduce similar SHRT_MAX limits as in man(7), fixing a few cases of infinite output found by jsg@ with afl.
Diffstat (limited to 'term.c')
-rw-r--r--term.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/term.c b/term.c
index 3efc2709..61fe0c3b 100644
--- a/term.c
+++ b/term.c
@@ -273,7 +273,7 @@ term_flushln(struct termp *p)
}
if (TERMP_HANG & p->flags) {
- p->overstep = (int)(vis - maxvis +
+ p->overstep += (int)(p->offset + vis - p->rmargin +
p->trailspace * (*p->width)(p, ' '));
/*