summaryrefslogtreecommitdiffstats
path: root/man_macro.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-03-25 15:17:49 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-03-25 15:17:49 +0000
commit12bf2f26f8d476960eba07e14e64fd26661da3b3 (patch)
treeb759d2d2e7467b1cffc89fb98e9d6e4ccb5bdbed /man_macro.c
parent4b4e799e741ce5040d46930f13430debab688774 (diff)
downloadmandoc-12bf2f26f8d476960eba07e14e64fd26661da3b3.tar.gz
Added man validator, renamed mdoc validator.
Diffstat (limited to 'man_macro.c')
-rw-r--r--man_macro.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/man_macro.c b/man_macro.c
index 05a95d22..651b7503 100644
--- a/man_macro.c
+++ b/man_macro.c
@@ -56,9 +56,14 @@ man_macro(struct man *man, int tok, int line,
man->next = MAN_NEXT_SIBLING;
}
- /* TODO: validate & actions. */
+ for ( ; man->last && man->last != n;
+ man->last = man->last->parent)
+ if ( ! man_valid_post(man))
+ return(0);
- man->last = n;
+ assert(man->last);
+ if ( ! man_valid_post(man))
+ return(0);
man->next = MAN_NEXT_SIBLING;
return(1);