diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-02-05 01:46:56 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-02-05 01:46:56 +0000 |
commit | 902f6a979cb9238ddee3e60feebb858f2c773e7f (patch) | |
tree | 2bfaae099eaf4cc972ec0029c5ffbd9d4e62586f /mdoc_validate.c | |
parent | 4514bbe8133f9b6a03f35d9c4321d64e48e6cf33 (diff) | |
download | mandoc-902f6a979cb9238ddee3e60feebb858f2c773e7f.tar.gz |
fix handling of empty .An macros
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r-- | mdoc_validate.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c index c246385e..5b77ca73 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -1168,10 +1168,12 @@ post_an(POST_ARGS) struct mdoc_node *np, *nch; np = mdoc->last; - if (AUTH__NONE == np->norm->An.auth) { - if (0 == np->child) - check_count(mdoc, MDOC_ELEM, CHECK_GT, 0); - } else if ((nch = np->child) != NULL) + nch = np->child; + if (np->norm->An.auth == AUTH__NONE) { + if (nch == NULL) + mandoc_msg(MANDOCERR_MACRO_EMPTY, mdoc->parse, + np->line, np->pos, "An"); + } else if (nch != NULL) mandoc_vmsg(MANDOCERR_ARG_EXCESS, mdoc->parse, nch->line, nch->pos, "An ... %s", nch->string); } |