=================================================================== RCS file: /cvs/mandoc/Attic/mdoc_action.c,v retrieving revision 1.4 retrieving revision 1.6 diff -u -p -r1.4 -r1.6 --- mandoc/Attic/mdoc_action.c 2009/04/02 16:37:40 1.4 +++ mandoc/Attic/mdoc_action.c 2009/04/06 08:53:12 1.6 @@ -1,4 +1,4 @@ -/* $Id: mdoc_action.c,v 1.4 2009/04/02 16:37:40 kristaps Exp $ */ +/* $Id: mdoc_action.c,v 1.6 2009/04/06 08:53:12 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -212,9 +212,9 @@ mdoc_action_pre(struct mdoc *m, const struct mdoc_node break; } - if (NULL == mdoc_actions[m->last->tok].pre) + if (NULL == mdoc_actions[n->tok].pre) return(1); - return((*mdoc_actions[m->last->tok].pre)(m, n)); + return((*mdoc_actions[n->tok].pre)(m, n)); } @@ -343,11 +343,20 @@ post_nm(POST_ARGS) if (m->meta.name) return(1); + + printf("bar\n"); + + buf[0] = 0; if ( ! concat(m, m->last->child, buf, sizeof(buf))) return(0); + + printf("foo\n"); + if (NULL == (m->meta.name = strdup(buf))) return(verr(m, EMALLOC)); + printf("baz\n"); + return(1); } @@ -366,6 +375,8 @@ post_sh(POST_ARGS) if (MDOC_HEAD != m->last->type) return(1); + + buf[0] = 0; if ( ! concat(m, m->last->child, buf, sizeof(buf))) return(0); if (SEC_CUSTOM != (sec = mdoc_atosec(buf))) @@ -694,6 +705,7 @@ post_dd(POST_ARGS) { char buf[64]; + buf[0] = 0; if ( ! concat(m, m->last->child, buf, sizeof(buf))) return(0);