summaryrefslogtreecommitdiffstats
path: root/man_macro.c
diff options
context:
space:
mode:
Diffstat (limited to 'man_macro.c')
-rw-r--r--man_macro.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/man_macro.c b/man_macro.c
index 88f1f431..dcfd2dc3 100644
--- a/man_macro.c
+++ b/man_macro.c
@@ -337,31 +337,25 @@ blk_close(MACRO_PROT_ARGS)
void
blk_exp(MACRO_PROT_ARGS)
{
- struct man_node *n;
- int la;
+ struct man_node *head;
char *p;
+ int la;
rew_scope(MAN_BLOCK, man, tok);
man_block_alloc(man, line, ppos, tok);
man_head_alloc(man, line, ppos, tok);
+ head = man->last;
- for (;;) {
- la = *pos;
- if ( ! man_args(man, line, pos, buf, &p))
- break;
+ la = *pos;
+ if (man_args(man, line, pos, buf, &p))
man_word_alloc(man, line, la, p);
- }
-
- assert(man);
- assert(tok != MAN_MAX);
- for (n = man->last; n; n = n->parent)
- if (n->tok == tok) {
- assert(n->type == MAN_HEAD);
- man_unscope(man, n);
- break;
- }
+ if (buf[*pos] != '\0')
+ mandoc_vmsg(MANDOCERR_ARG_EXCESS,
+ man->parse, line, *pos, "%s ... %s",
+ man_macronames[tok], buf + *pos);
+ man_unscope(man, head);
man_body_alloc(man, line, ppos, tok);
}