-/* $OpenBSD: read.c,v 1.123 2016/07/10 13:33:50 schwarze Exp $ */
+/* $OpenBSD: read.c,v 1.124 2016/07/19 16:22:34 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2016 Ingo Schwarze <schwarze@openbsd.org>
}
}
- if (curp->man == NULL) {
- curp->man = roff_man_alloc(curp->roff, curp, curp->defos,
- curp->options & MPARSE_QUICK ? 1 : 0);
- curp->man->macroset = MACROSET_MAN;
- curp->man->first->tok = TOKEN_NONE;
- }
-
if (format == MPARSE_MDOC) {
mdoc_hash_init();
curp->man->macroset = MACROSET_MDOC;
break;
}
- /*
- * If input parsers have not been allocated, do so now.
- * We keep these instanced between parsers, but set them
- * locally per parse routine since we can use different
- * parsers with each one.
- */
-
- if (curp->man == NULL ||
- curp->man->macroset == MACROSET_NONE)
+ if (curp->man->macroset == MACROSET_NONE)
choose_parser(curp);
/*
static void
mparse_end(struct mparse *curp)
{
-
- if (curp->man == NULL && curp->sodest == NULL)
- curp->man = roff_man_alloc(curp->roff, curp, curp->defos,
- curp->options & MPARSE_QUICK ? 1 : 0);
if (curp->man->macroset == MACROSET_NONE)
curp->man->macroset = MACROSET_MAN;
if (curp->man->macroset == MACROSET_MDOC)
void
mparse_reset(struct mparse *curp)
{
-
roff_reset(curp->roff);
-
- if (curp->man != NULL)
- roff_man_reset(curp->man);
+ roff_man_reset(curp->man);
if (curp->secondary)
curp->secondary->sz = 0;