aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-04-08 04:40:47 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-04-08 04:40:47 +0000
commitafd2d83121837880082344a1125e3e44aa078d3e (patch)
tree505aea93113b45cf0567b87811a5c3b809ba4a3d /mdoc_term.c
parentd188baa4f65eb607975e6eac9d3709fd7724d486 (diff)
downloadmandoc-afd2d83121837880082344a1125e3e44aa078d3e.tar.gz
mandoc-afd2d83121837880082344a1125e3e44aa078d3e.tar.zst
mandoc-afd2d83121837880082344a1125e3e44aa078d3e.zip
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 'mdoc_term.c')
-rw-r--r--mdoc_term.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index aa29274f..85314f6f 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.261 2014/03/30 21:28:01 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.262 2014/04/08 04:40:47 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -1029,6 +1029,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);
}