diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-04-06 08:53:12 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-04-06 08:53:12 +0000 |
commit | 028529afdca12b0a55c80e45606f385d1237d1a7 (patch) | |
tree | bd998f2cfd44f97925a5c8f2004f46bdf41bccf5 | |
parent | ac2a4155cad12fdfd476afb4f99396b000c78ce5 (diff) | |
download | mandoc-028529afdca12b0a55c80e45606f385d1237d1a7.tar.gz mandoc-028529afdca12b0a55c80e45606f385d1237d1a7.tar.zst mandoc-028529afdca12b0a55c80e45606f385d1237d1a7.zip |
Fix bogus use of mdoc->last in action pre-handler (!!!!!).
-rw-r--r-- | mdoc_action.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/mdoc_action.c b/mdoc_action.c index c1577145..9f8035b3 100644 --- a/mdoc_action.c +++ b/mdoc_action.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_action.c,v 1.5 2009/04/03 11:08:39 kristaps Exp $ */ +/* $Id: mdoc_action.c,v 1.6 2009/04/06 08:53:12 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@openbsd.org> * @@ -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); } |