diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-08-21 13:45:33 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-08-21 13:45:33 +0000 |
commit | 422eea354d16149a590fff2c9822f4dbde0e4bfa (patch) | |
tree | 286f03c4bcd0b6bc12c940065a4d42785388b0b8 /man.c | |
parent | aacafd8e1cfcbbe8e4fcaeabee27c68fce57991b (diff) | |
download | mandoc-422eea354d16149a590fff2c9822f4dbde0e4bfa.tar.gz |
Fix of MAN_NEXT when removing next-line dupes.VERSION.1.9.1
Diffstat (limited to 'man.c')
-rw-r--r-- | man.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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); |