aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit99675b100277273906e22e0a39880cb928874a24 (patch)
tree46cdff847b472e54cf55eae0e98502af19152f79 /term.c
parent4779d1b30e29ee1f848dbfdced4e200abc5f99a8 (diff)
downloadmandoc-99675b100277273906e22e0a39880cb928874a24.tar.gz
mandoc-99675b100277273906e22e0a39880cb928874a24.tar.zst
mandoc-99675b100277273906e22e0a39880cb928874a24.zip
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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/term.c b/term.c
index 0f39525b..e6e3f641 100644
--- a/term.c
+++ b/term.c
@@ -1,4 +1,4 @@
-/* $Id: term.c,v 1.241 2014/12/24 09:58:35 schwarze Exp $ */
+/* $Id: term.c,v 1.242 2014/12/24 23:32:42 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -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, ' '));
/*