=================================================================== RCS file: /cvs/mandoc/Attic/man_action.c,v retrieving revision 1.2 retrieving revision 1.4 diff -u -p -r1.2 -r1.4 --- mandoc/Attic/man_action.c 2009/03/25 16:07:36 1.2 +++ mandoc/Attic/man_action.c 2009/03/26 09:55:39 1.4 @@ -1,4 +1,4 @@ -/* $Id: man_action.c,v 1.2 2009/03/25 16:07:36 kristaps Exp $ */ +/* $Id: man_action.c,v 1.4 2009/03/26 09:55:39 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -27,6 +27,9 @@ #include "libman.h" +#ifdef __linux__ +extern char *strptime(const char *, const char *, struct tm *); +#endif struct actions { int (*post)(struct man *); @@ -150,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);