aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-04-05 23:04:41 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-04-05 23:04:41 +0000
commite870afcbdc7daf017837e9e2069000d1c6bc5f58 (patch)
treef13e52058b572949cd034dd150dc0ec02856cba1
parent848c241a277a078d26be26a69572994040826469 (diff)
downloadmandoc-e870afcbdc7daf017837e9e2069000d1c6bc5f58.tar.gz
mandoc-e870afcbdc7daf017837e9e2069000d1c6bc5f58.tar.zst
mandoc-e870afcbdc7daf017837e9e2069000d1c6bc5f58.zip
If a partial explicit block extending to the next input line follows
the end macro of a broken block, put all of it into the breaking block. Needed for example by mutella(1).
-rw-r--r--mdoc_macro.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c
index 90f487aa..61d9148d 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_macro.c,v 1.187 2015/04/05 22:44:20 schwarze Exp $ */
+/* $Id: mdoc_macro.c,v 1.188 2015/04/05 23:04:41 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -527,8 +527,9 @@ blk_exp_close(MACRO_PROT_ARGS)
struct roff_node *itblk; /* An It block starting later. */
struct roff_node *later; /* A sub-block starting later. */
struct roff_node *n; /* Search back to our block. */
+ struct roff_node *target; /* For find_pending(). */
- int j, lastarg, maxargs, nl;
+ int j, lastarg, maxargs, nl, pending;
enum margserr ac;
int atok, ntok;
char *p;
@@ -690,8 +691,19 @@ blk_exp_close(MACRO_PROT_ARGS)
break;
}
- if (n != NULL)
- rew_pending(mdoc, n);
+ if (n != NULL) {
+ if (n != mdoc->last && n->flags & MDOC_BROKEN) {
+ target = n;
+ do
+ target = target->parent;
+ while ( ! (target->flags & MDOC_ENDED));
+ pending = find_pending(mdoc, ntok, line, ppos,
+ target);
+ } else
+ pending = 0;
+ if ( ! pending)
+ rew_pending(mdoc, n);
+ }
if (nl)
append_delims(mdoc, line, pos, buf);
}