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 | |
parent | 4514bbe8133f9b6a03f35d9c4321d64e48e6cf33 (diff) | |
download | mandoc-902f6a979cb9238ddee3e60feebb858f2c773e7f.tar.gz |
fix handling of empty .An macros
-rw-r--r-- | mdoc_html.c | 3 | ||||
-rw-r--r-- | mdoc_macro.c | 2 | ||||
-rw-r--r-- | mdoc_term.c | 3 | ||||
-rw-r--r-- | mdoc_validate.c | 10 |
4 files changed, 7 insertions, 11 deletions
diff --git a/mdoc_html.c b/mdoc_html.c index 82aa5d95..3d699e61 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1253,9 +1253,6 @@ mdoc_an_pre(MDOC_ARGS) return(0); } - if (n->child == NULL) - return(0); - if (h->flags & HTML_SPLIT) print_otag(h, TAG_BR, 0, NULL); diff --git a/mdoc_macro.c b/mdoc_macro.c index 00bd7fa7..78a8e5e6 100644 --- a/mdoc_macro.c +++ b/mdoc_macro.c @@ -772,7 +772,7 @@ in_line(MACRO_PROT_ARGS) */ if (ac == ARGS_PUNCT) { - if (cnt == 0 && nc == 0) + if (cnt == 0 && (nc == 0 || tok == MDOC_An)) mdoc->flags |= MDOC_NODELIMC; break; } diff --git a/mdoc_term.c b/mdoc_term.c index d101bbb3..0c13f8c1 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -1091,9 +1091,6 @@ termp_an_pre(DECL_ARGS) return(0); } - if (n->child == NULL) - return(0); - if (p->flags & TERMP_SPLIT) term_newln(p); 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); } |