summaryrefslogtreecommitdiffstats
path: root/mdoc_macro.c
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
commit233ca483e954fead4829c75df068ed734b00fd1b (patch)
tree1555280f18586aaf8b6a11bcb0a70eb4653f6b1b /mdoc_macro.c
parent4de1394de55295a742ed82f7f8070b4cf97879fd (diff)
downloadmandoc-233ca483e954fead4829c75df068ed734b00fd1b.tar.gz
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).
Diffstat (limited to 'mdoc_macro.c')
-rw-r--r--mdoc_macro.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c
index c04f7a3e..763866da 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -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);
}