summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2016-07-19 16:22:34 +0000
committerschwarze <schwarze@openbsd.org>2016-07-19 16:22:34 +0000
commit969858aeecaa06945deb4fe2339e066219db92d5 (patch)
treeface26f071e5e6b0f23e9c18d1db78c383e21e90
parentFix the check supposed to prevent 'ip' and 'ip-stealth' balancing modes (diff)
downloadwireguard-openbsd-969858aeecaa06945deb4fe2339e066219db92d5.tar.xz
wireguard-openbsd-969858aeecaa06945deb4fe2339e066219db92d5.zip
Since the mdoc/man parser unification, the parser is always allocated
in mparse_alloc(), so delete all the curp->man == NULL checks. Triggered by a patch from Christos Zoulas suggesting to add yet another such check.
-rw-r--r--usr.bin/mandoc/read.c28
1 files changed, 3 insertions, 25 deletions
diff --git a/usr.bin/mandoc/read.c b/usr.bin/mandoc/read.c
index 100965e22ca..65ecff72194 100644
--- a/usr.bin/mandoc/read.c
+++ b/usr.bin/mandoc/read.c
@@ -1,4 +1,4 @@
-/* $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>
@@ -284,13 +284,6 @@ choose_parser(struct mparse *curp)
}
}
- 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;
@@ -555,15 +548,7 @@ rerun:
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);
/*
@@ -673,10 +658,6 @@ read_whole_file(struct mparse *curp, const char *file, int fd,
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)
@@ -817,11 +798,8 @@ mparse_alloc(int options, enum mandoclevel wlevel, mandocmsg mmsg,
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;