diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-04-06 11:52:25 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-04-06 11:52:25 +0000 |
commit | 81497a9c2422b5691aba06535567ec17353ea4f2 (patch) | |
tree | d1808da8f582b26eae1ceb364cb059ff4abea74f /mdoc_validate.c | |
parent | 342633680fca944054cb3c86bbe7ebc040381b1f (diff) | |
download | mandoc-81497a9c2422b5691aba06535567ec17353ea4f2.tar.gz |
Cleaned up post_bl_head() and fixed erroneous reporting of child nodes.
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r-- | mdoc_validate.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c index 46849243..a50e820b 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -1095,22 +1095,23 @@ post_bl_head(POST_ARGS) { int i; const struct mdoc_node *n; + const struct mdoc_argv *a; n = mdoc->last->parent; assert(n->args); - for (i = 0; i < (int)n->args->argc; i++) - if (n->args->argv[i].arg == MDOC_Column) - break; - - if (i == (int)n->args->argc && n->nchild) - return(warn_count(mdoc, "==", 0, - "line arguments", n->nchild)); - - if (n->args->argv[i].sz && mdoc->last->child) - return(mdoc_nerr(mdoc, n, ECOLMIS)); + for (i = 0; i < (int)n->args->argc; i++) { + a = &n->args->argv[i]; + if (a->arg == MDOC_Column) { + if (a->sz && mdoc->last->nchild) + return(mdoc_nerr(mdoc, n, ECOLMIS)); + return(1); + } + } - return(1); + if (0 == (i = mdoc->last->nchild)) + return(1); + return(warn_count(mdoc, "==", 0, "line arguments", i)); } |