summaryrefslogtreecommitdiffstatshomepage
path: root/man_macro.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-03-25 15:36:05 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-03-25 15:36:05 +0000
commitc1e7dc6253e70fb184882bdb155d380f00698ce9 (patch)
treea61c03fc338e61b996f98d19a85482d805674c32 /man_macro.c
parentaee6df6eb688c812a34d9a363dda978f06095003 (diff)
downloadmandoc-c1e7dc6253e70fb184882bdb155d380f00698ce9.tar.gz
mandoc-c1e7dc6253e70fb184882bdb155d380f00698ce9.tar.zst
mandoc-c1e7dc6253e70fb184882bdb155d380f00698ce9.zip
Added man_action.c, renamed mdoc_action.c.
Diffstat (limited to 'man_macro.c')
-rw-r--r--man_macro.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/man_macro.c b/man_macro.c
index 8b2164e8..d03d12c5 100644
--- a/man_macro.c
+++ b/man_macro.c
@@ -1,4 +1,4 @@
-/* $Id: man_macro.c,v 1.5 2009/03/25 15:17:49 kristaps Exp $ */
+/* $Id: man_macro.c,v 1.6 2009/03/25 15:36:05 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@openbsd.org>
*
@@ -57,13 +57,20 @@ man_macro(struct man *man, int tok, int line,
}
for ( ; man->last && man->last != n;
- man->last = man->last->parent)
+ man->last = man->last->parent) {
if ( ! man_valid_post(man))
return(0);
+ if ( ! man_action_post(man))
+ return(0);
+ }
assert(man->last);
+
if ( ! man_valid_post(man))
return(0);
+ if ( ! man_action_post(man))
+ return(0);
+
man->next = MAN_NEXT_SIBLING;
return(1);
@@ -74,7 +81,19 @@ int
man_macroend(struct man *m)
{
- /* TODO: validate & actions. */
+ for ( ; m->last && m->last != m->first;
+ m->last = m->last->parent) {
+ if ( ! man_valid_post(m))
+ return(0);
+ if ( ! man_action_post(m))
+ return(0);
+ }
+
+ if ( ! man_valid_post(m))
+ return(0);
+ if ( ! man_action_post(m))
+ return(0);
+
return(1);
}