summaryrefslogtreecommitdiffstats
path: root/mdoc_validate.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-04-06 11:52:25 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-04-06 11:52:25 +0000
commit81497a9c2422b5691aba06535567ec17353ea4f2 (patch)
treed1808da8f582b26eae1ceb364cb059ff4abea74f /mdoc_validate.c
parent342633680fca944054cb3c86bbe7ebc040381b1f (diff)
downloadmandoc-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.c23
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));
}