summaryrefslogtreecommitdiffstats
path: root/roff.c
diff options
context:
space:
mode:
Diffstat (limited to 'roff.c')
-rw-r--r--roff.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/roff.c b/roff.c
index 34059954..10cefea0 100644
--- a/roff.c
+++ b/roff.c
@@ -819,18 +819,25 @@ roff_man_free1(struct roff_man *man)
free(man->meta.sodest);
}
+void
+roff_state_reset(struct roff_man *man)
+{
+ man->last = man->meta.first;
+ man->last_es = NULL;
+ man->flags = 0;
+ man->lastsec = man->lastnamed = SEC_NONE;
+ man->next = ROFF_NEXT_CHILD;
+ roff_setreg(man->roff, "nS", 0, '=');
+}
+
static void
roff_man_alloc1(struct roff_man *man)
{
memset(&man->meta, 0, sizeof(man->meta));
man->meta.first = mandoc_calloc(1, sizeof(*man->meta.first));
man->meta.first->type = ROFFT_ROOT;
- man->last = man->meta.first;
- man->last_es = NULL;
- man->flags = 0;
man->meta.macroset = MACROSET_NONE;
- man->lastsec = man->lastnamed = SEC_NONE;
- man->next = ROFF_NEXT_CHILD;
+ roff_state_reset(man);
}
void