summaryrefslogtreecommitdiffstatshomepage
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
commit48c75ac0d363231aad256b8377a73bc1f8d158d5 (patch)
tree92966078d91ba12155f189f933548b38f9d08349 /man_action.c
parentef64725c09db0346dd0d5a32ae063e383d216b33 (diff)
downloadmandoc-48c75ac0d363231aad256b8377a73bc1f8d158d5.tar.gz
mandoc-48c75ac0d363231aad256b8377a73bc1f8d158d5.tar.zst
mandoc-48c75ac0d363231aad256b8377a73bc1f8d158d5.zip
Fixed reading whitespace for man.7 `. TH'.
Documented this.
Diffstat (limited to 'man_action.c')
-rw-r--r--man_action.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/man_action.c b/man_action.c
index fb29115a..a19dfa0f 100644
--- a/man_action.c
+++ b/man_action.c
@@ -1,4 +1,4 @@
-/* $Id: man_action.c,v 1.3 2009/03/25 16:08:30 kristaps Exp $ */
+/* $Id: man_action.c,v 1.4 2009/03/26 09:55:39 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@openbsd.org>
*
@@ -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);