From b303922601f56d18c6f93423c4ff3d27382f885e Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Tue, 24 Dec 2013 19:11:45 +0000 Subject: 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. --- mdoc_macro.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'mdoc_macro.c') 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 * Copyright (c) 2010, 2012, 2013 Ingo Schwarze @@ -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): -- cgit v1.2.3