summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/man.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2009-06-23 22:31:26 +0000
committerschwarze <schwarze@openbsd.org>2009-06-23 22:31:26 +0000
commit0adfad74fcdc1750dc012ffadb8e0cc3651121ba (patch)
treebf1009ec6de302220bf7aa63eacedb8974951800 /usr.bin/mandoc/man.c
parentAdd some common config file examples to the quick start section. (diff)
downloadwireguard-openbsd-0adfad74fcdc1750dc012ffadb8e0cc3651121ba.tar.xz
wireguard-openbsd-0adfad74fcdc1750dc012ffadb8e0cc3651121ba.zip
sync to 1.7.20: root and text validation for -man
Diffstat (limited to 'usr.bin/mandoc/man.c')
-rw-r--r--usr.bin/mandoc/man.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/mandoc/man.c b/usr.bin/mandoc/man.c
index 6c00c53c852..cfa06a08604 100644
--- a/usr.bin/mandoc/man.c
+++ b/usr.bin/mandoc/man.c
@@ -1,4 +1,4 @@
-/* $Id: man.c,v 1.4 2009/06/23 22:05:42 schwarze Exp $ */
+/* $Id: man.c,v 1.5 2009/06/23 22:31:26 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -182,6 +182,8 @@ man_node_append(struct man *man, struct man_node *p)
abort();
/* NOTREACHED */
}
+
+ p->parent->nchild++;
man->last = p;
@@ -250,6 +252,8 @@ man_node_free(struct man_node *p)
if (p->string)
free(p->string);
+ if (p->parent)
+ p->parent->nchild--;
free(p);
}
@@ -263,6 +267,7 @@ man_node_freelist(struct man_node *p)
if (p->next)
man_node_freelist(p->next);
+ assert(0 == p->nchild);
man_node_free(p);
}