summaryrefslogtreecommitdiffstatshomepage
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
commitaee6df6eb688c812a34d9a363dda978f06095003 (patch)
treed99bb9b2ce6d25b71e560347d01dc9525953ad4b /man_macro.c
parente0c48e25273aab3cab4440442865955afff07b02 (diff)
downloadmandoc-aee6df6eb688c812a34d9a363dda978f06095003.tar.gz
mandoc-aee6df6eb688c812a34d9a363dda978f06095003.tar.zst
mandoc-aee6df6eb688c812a34d9a363dda978f06095003.zip
Added man validator, renamed mdoc validator.
Diffstat (limited to 'man_macro.c')
-rw-r--r--man_macro.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/man_macro.c b/man_macro.c
index baeea39f..8b2164e8 100644
--- a/man_macro.c
+++ b/man_macro.c
@@ -1,4 +1,4 @@
-/* $Id: man_macro.c,v 1.4 2009/03/23 15:41:09 kristaps Exp $ */
+/* $Id: man_macro.c,v 1.5 2009/03/25 15:17:49 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@openbsd.org>
*
@@ -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);