summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-04-06 08:53:12 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-04-06 08:53:12 +0000
commita06b4ac0f77bca1207342130110de93bef15ea21 (patch)
tree1b1a3d84bec14d66556c99dea233f40ff7c70ed5
parent5d07e013469fedd47256ee7ec24792c0f4135e6d (diff)
downloadmandoc-a06b4ac0f77bca1207342130110de93bef15ea21.tar.gz
Fix bogus use of mdoc->last in action pre-handler (!!!!!).
-rw-r--r--mdoc_action.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/mdoc_action.c b/mdoc_action.c
index 6e4834f9..49d92b19 100644
--- a/mdoc_action.c
+++ b/mdoc_action.c
@@ -212,9 +212,9 @@ mdoc_action_pre(struct mdoc *m, const struct mdoc_node *n)
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));
}
@@ -344,12 +344,19 @@ 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);
}