summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdoc_action.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mdoc_action.c b/mdoc_action.c
index c6cce90e..3e924dbf 100644
--- a/mdoc_action.c
+++ b/mdoc_action.c
@@ -420,7 +420,11 @@ post_sh(POST_ARGS)
if ( ! concat(m, buf, n->child, BUFSIZ))
return(0);
sec = mdoc_atosec(buf);
- if (SEC_CUSTOM != sec)
+ /*
+ * The first section should always make us move into a non-new
+ * state.
+ */
+ if (SEC_NONE == m->lastnamed || SEC_CUSTOM != sec)
m->lastnamed = sec;
/* Some sections only live in certain manual sections. */