summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/man.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2009-06-23 22:31:27 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2009-06-23 22:31:27 +0000
commitefac769419567f13c2a4f60f6fd0c0c955cd6811 (patch)
treefdb0ee8495a1837402aff8f73ea6c137c38da98e /usr.bin/mandoc/man.c
parentad4bfb99fde5cb4c7f0f05ec493e09b53f62b67d (diff)
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);
}