summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-08-21 13:45:33 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-08-21 13:45:33 +0000
commit422eea354d16149a590fff2c9822f4dbde0e4bfa (patch)
tree286f03c4bcd0b6bc12c940065a4d42785388b0b8
parentaacafd8e1cfcbbe8e4fcaeabee27c68fce57991b (diff)
downloadmandoc-422eea354d16149a590fff2c9822f4dbde0e4bfa.tar.gz
Fix of MAN_NEXT when removing next-line dupes.VERSION.1.9.1
-rw-r--r--man.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/man.c b/man.c
index de25c362..f2031616 100644
--- a/man.c
+++ b/man.c
@@ -378,14 +378,15 @@ man_node_free(struct man_node *p)
void
man_node_freelist(struct man_node *p)
{
+ struct man_node *n;
if (p->child)
man_node_freelist(p->child);
- if (p->next)
- man_node_freelist(p->next);
-
assert(0 == p->nchild);
+ n = p->next;
man_node_free(p);
+ if (n)
+ man_node_freelist(n);
}
@@ -526,6 +527,7 @@ man_pmacro(struct man *m, int ln, char *buf)
if (m->flags & MAN_ELINE) {
n = m->last;
assert(NULL == n->child);
+ assert(0 == n->nchild);
if ( ! man_nwarn(m, n, WLNSCOPE))
return(0);
@@ -534,10 +536,12 @@ man_pmacro(struct man *m, int ln, char *buf)
assert(n == n->prev->next);
n->prev->next = NULL;
m->last = n->prev;
+ m->next = MAN_NEXT_SIBLING;
} else {
assert(n == n->parent->child);
n->parent->child = NULL;
m->last = n->parent;
+ m->next = MAN_NEXT_CHILD;
}
man_node_free(n);