aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_action.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-06-18 20:46:19 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-06-18 20:46:19 +0000
commit65dc168510767708e266ed70c10c9e2a646424fa (patch)
tree893ef034f49f88a19a1a3a753e0d514227aaa6ce /mdoc_action.c
parent5a58b9c46f195b91a6e97db9ae3778de5e5bae2f (diff)
downloadmandoc-65dc168510767708e266ed70c10c9e2a646424fa.tar.gz
mandoc-65dc168510767708e266ed70c10c9e2a646424fa.tar.zst
mandoc-65dc168510767708e266ed70c10c9e2a646424fa.zip
Added nchild decrement in libman (not used, but better in than forgotten).
Added nchild to libmdoc, deprecated count() functions in validator.
Diffstat (limited to 'mdoc_action.c')
-rw-r--r--mdoc_action.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/mdoc_action.c b/mdoc_action.c
index 56ff7565..13ce974c 100644
--- a/mdoc_action.c
+++ b/mdoc_action.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_action.c,v 1.16 2009/06/17 14:14:51 kristaps Exp $ */
+/* $Id: mdoc_action.c,v 1.17 2009/06/18 20:46:19 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -663,11 +663,9 @@ post_bl_head(POST_ARGS)
* column field. Then, delete the head children.
*/
- for (i = 0, nn = m->last->child; nn; nn = nn->next, i++)
- /* Count children. */;
-
- n->args->argv[c].sz = (size_t)i;
- n->args->argv[c].value = malloc((size_t)i * sizeof(char *));
+ n->args->argv[c].sz = (size_t)m->last->nchild;
+ n->args->argv[c].value = malloc
+ ((size_t)m->last->nchild * sizeof(char *));
for (i = 0, nn = m->last->child; nn; i++) {
n->args->argv[c].value[i] = nn->string;
@@ -677,7 +675,9 @@ post_bl_head(POST_ARGS)
mdoc_node_free(nnp);
}
+ m->last->nchild = 0;
m->last->child = NULL;
+
return(1);
}