diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-06-18 20:46:19 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-06-18 20:46:19 +0000 |
commit | 02772d7cbebdade86dabcbbc9d19e72db2bd0b43 (patch) | |
tree | cd69db8c6dcccdbdc0b519f7d88aaacc22dbac4d /mdoc.c | |
parent | e2d8679f361643c8410c69f218268085075bc428 (diff) | |
download | mandoc-02772d7cbebdade86dabcbbc9d19e72db2bd0b43.tar.gz |
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.c')
-rw-r--r-- | mdoc.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -442,6 +442,8 @@ node_append(struct mdoc *mdoc, struct mdoc_node *p) /* NOTREACHED */ } + p->parent->nchild++; + if ( ! mdoc_valid_pre(mdoc, p)) return(0); if ( ! mdoc_action_pre(mdoc, p)) @@ -597,6 +599,8 @@ void mdoc_node_free(struct mdoc_node *p) { + if (p->parent) + p->parent->nchild--; if (p->string) free(p->string); if (p->args) @@ -614,6 +618,7 @@ mdoc_node_freelist(struct mdoc_node *p) if (p->next) mdoc_node_freelist(p->next); + assert(0 == p->nchild); mdoc_node_free(p); } |