summaryrefslogtreecommitdiffstats
path: root/man_action.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-03-26 09:55:39 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-03-26 09:55:39 +0000
commit35f2108111d8f83fc25edd4c460e0f37db93901b (patch)
treea2a14f413a5220dcb10ce51e46fdeaa6d9b319e3 /man_action.c
parentd31b9aced380c9834f45869247dfbd42922d533b (diff)
downloadmandoc-35f2108111d8f83fc25edd4c460e0f37db93901b.tar.gz
Fixed reading whitespace for man.7 `. TH'.
Documented this.
Diffstat (limited to 'man_action.c')
-rw-r--r--man_action.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/man_action.c b/man_action.c
index 00a284d8..e159baa5 100644
--- a/man_action.c
+++ b/man_action.c
@@ -153,12 +153,20 @@ post_TH(struct man *m)
* of the syntax tree (they encompass only meta-data).
*/
- assert(MAN_ROOT == m->last->parent->type);
- m->last->parent->child = NULL;
- n = m->last;
- m->last = m->last->parent;
- m->next = MAN_NEXT_CHILD;
- assert(m->last == m->first);
+ if (m->last->parent->child == m->last) {
+ assert(MAN_ROOT == m->last->parent->type);
+ m->last->parent->child = NULL;
+ n = m->last;
+ m->last = m->last->parent;
+ m->next = MAN_NEXT_CHILD;
+ assert(m->last == m->first);
+ } else {
+ assert(m->last->prev);
+ m->last->prev->next = NULL;
+ n = m->last;
+ m->last = m->last->prev;
+ m->next = MAN_NEXT_SIBLING;
+ }
man_node_freelist(n);
return(1);