diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2013-12-24 19:11:45 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2013-12-24 19:11:45 +0000 |
commit | 8d226e7d9f28fbbca5bd6969e8fe3e6ee69ec94e (patch) | |
tree | e007bba721cb9d9e5ad54d2316dd8d2fd6ff6fdd /mdoc_macro.c | |
parent | 843cccd2fcf4de8a13a16071c949374ee597d16e (diff) | |
download | mandoc-8d226e7d9f28fbbca5bd6969e8fe3e6ee69ec94e.tar.gz |
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.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c index 61ca534a..fd3f8764 100644 --- a/mdoc_macro.c +++ b/mdoc_macro.c @@ -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): |