summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2011-01-11 00:59:29 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2011-01-11 00:59:29 +0000
commit7857258c3fd2c8204bbf0f53b205826d7051991d (patch)
treed35f64f2d935b68f6b4d72e85e8d9181195bf38d /usr.bin/mandoc
parent32091ea77a0c9b3c6bdba26aa50d7d9212d45bd3 (diff)
When (cumulative) indentation requested by .in exceeds the right
margin, do not run into an assert(3)ion. Problem reported by brad@ in gm(1), fix by kristaps@.
Diffstat (limited to 'usr.bin/mandoc')
-rw-r--r--usr.bin/mandoc/man_term.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c
index 27abd27c91b..0cdf4ca08c4 100644
--- a/usr.bin/mandoc/man_term.c
+++ b/usr.bin/mandoc/man_term.c
@@ -1,4 +1,4 @@
-/* $Id: man_term.c,v 1.58 2011/01/04 22:28:17 schwarze Exp $ */
+/* $Id: man_term.c,v 1.59 2011/01/11 00:59:28 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -393,6 +393,11 @@ pre_in(DECL_ARGS)
else
p->offset = v;
+ /* Don't let this creep beyond the right margin. */
+
+ if (p->offset > p->rmargin)
+ p->offset = p->rmargin;
+
return(0);
}