diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2015-02-01 23:55:38 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2015-02-01 23:55:38 +0000 |
commit | 5e889aeb7972bb185576e01b025ce186f4901dae (patch) | |
tree | f1e63bdf23c218e69bafe18a73211d5f6425e4ee | |
parent | bdef2fadb9109ca7d68769232896a3314c2e0d84 (diff) |
get rid of rew_sub() in blk_part_imp(); no functional change
-rw-r--r-- | usr.bin/mandoc/mdoc_macro.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/usr.bin/mandoc/mdoc_macro.c b/usr.bin/mandoc/mdoc_macro.c index ccb1e4cc0f5..9c152ea9158 100644 --- a/usr.bin/mandoc/mdoc_macro.c +++ b/usr.bin/mandoc/mdoc_macro.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc_macro.c,v 1.119 2015/02/01 17:30:34 schwarze Exp $ */ +/* $OpenBSD: mdoc_macro.c,v 1.120 2015/02/01 23:55:37 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2012-2015 Ingo Schwarze <schwarze@openbsd.org> @@ -1319,10 +1319,21 @@ blk_part_imp(MACRO_PROT_ARGS) } } assert(n == body); - rew_sub(MDOC_BODY, mdoc, tok, line, ppos); + rew_last(mdoc, body); if (nl) append_delims(mdoc, line, pos, buf); - rew_sub(MDOC_BLOCK, mdoc, tok, line, ppos); + rew_last(mdoc, blk); + + /* + * The current block extends an enclosing block. + * Now that the current block ends, close the enclosing block, too. + */ + + while ((blk = blk->pending) != NULL) { + rew_last(mdoc, blk); + if (blk->type == MDOC_HEAD) + mdoc_body_alloc(mdoc, blk->line, blk->pos, blk->tok); + } /* Move trailing .Ns out of scope. */ |