summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2014-04-08 04:40:30 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2014-04-08 04:40:30 +0000
commit599b8a5de0fd10dafc7eb71efd7e9ce20e78250a (patch)
tree9f0e5c2289d34d1bf933ef131570560f24aaf9bf /usr.bin
parent3ac45b772490cfb17e6c88e273eafe14e56655c1 (diff)
If the SYNOPSIS section contains an excessively long .Nm,
adjust the right margin to avoid running into an assertion; output in that case now agrees with groff, too.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mandoc/mdoc_term.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/mandoc/mdoc_term.c b/usr.bin/mandoc/mdoc_term.c
index de7080cc629..ff4a59b6d82 100644
--- a/usr.bin/mandoc/mdoc_term.c
+++ b/usr.bin/mandoc/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.163 2014/03/30 21:27:59 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.164 2014/04/08 04:40:29 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -1025,6 +1025,8 @@ termp_nm_pre(DECL_ARGS)
MDOC_TEXT == n->prev->child->type ?
term_strlen(p, n->prev->child->string) :
term_len(p, 5));
+ if (p->rmargin < p->offset)
+ p->rmargin = p->offset;
return(1);
}