aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_macro.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2013-12-24 19:11:45 +0000
committerIngo Schwarze <schwarze@openbsd.org>2013-12-24 19:11:45 +0000
commitb303922601f56d18c6f93423c4ff3d27382f885e (patch)
treeffc9e8ded8098926789638d9ae1ecb3aec856e4e /mdoc_macro.c
parent34224dec94613f2de8682103514f13b796cbb181 (diff)
downloadmandoc-b303922601f56d18c6f93423c4ff3d27382f885e.tar.gz
mandoc-b303922601f56d18c6f93423c4ff3d27382f885e.tar.zst
mandoc-b303922601f56d18c6f93423c4ff3d27382f885e.zip
When deciding whether two consecutive macros are on the same input line,
we have to compare the line where the first one *ends* (not where it begins) to the line where the second one starts. This fixes the bug that .Bk allowed output line breaks right after block macros spanning more than one input line, even when the next macro follows on the same line.
Diffstat (limited to 'mdoc_macro.c')
-rw-r--r--mdoc_macro.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c
index 4a018eed..cbf90d2c 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_macro.c,v 1.123 2013/10/21 23:47:58 schwarze Exp $ */
+/* $Id: mdoc_macro.c,v 1.124 2013/12/24 19:11:46 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>
@@ -561,6 +561,9 @@ rew_sub(enum mdoc_type t, struct mdoc *mdoc,
case (REWIND_NONE):
return(1);
case (REWIND_THIS):
+ n->lastline = line -
+ (MDOC_NEWLINE & mdoc->flags &&
+ ! (MDOC_EXPLICIT & mdoc_macros[tok].flags));
break;
case (REWIND_FORCE):
mandoc_vmsg(MANDOCERR_SCOPEBROKEN, mdoc->parse,
@@ -569,6 +572,8 @@ rew_sub(enum mdoc_type t, struct mdoc *mdoc,
mdoc_macronames[n->tok]);
/* FALLTHROUGH */
case (REWIND_MORE):
+ n->lastline = line -
+ (MDOC_NEWLINE & mdoc->flags ? 1 : 0);
n = n->parent;
continue;
case (REWIND_LATER):