summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-04-18 16:34:25 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-04-18 16:34:25 +0000
commit19dfb5cab356150bf46d159f43ead732a6a6ade5 (patch)
tree79243b72064d2dfc284d040592d6f69b6a983ad7 /main.c
parent87a05fb3c50ab6e9a1befb22c6e63e3e47f571f3 (diff)
downloadmandoc-19dfb5cab356150bf46d159f43ead732a6a6ade5.tar.gz
Profit from the unified struct roff_man and reduce the number of
arguments of mparse_result() by one. No functional change. Written on the ICE Bruxelles-Koeln on the way back from p2k15.
Diffstat (limited to 'main.c')
-rw-r--r--main.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/main.c b/main.c
index 9678b314..ed73e687 100644
--- a/main.c
+++ b/main.c
@@ -632,7 +632,6 @@ static void
parse(struct curparse *curp, int fd, const char *file)
{
enum mandoclevel rctmp;
- struct roff_man *mdoc;
struct roff_man *man;
/* Begin by parsing the file itself. */
@@ -720,14 +719,16 @@ parse(struct curparse *curp, int fd, const char *file)
}
}
- mparse_result(curp->mp, &mdoc, &man, NULL);
+ mparse_result(curp->mp, &man, NULL);
/* Execute the out device, if it exists. */
- if (man && curp->outman)
+ if (man == NULL)
+ return;
+ if (curp->outmdoc != NULL && man->macroset == MACROSET_MDOC)
+ (*curp->outmdoc)(curp->outdata, man);
+ if (curp->outman != NULL && man->macroset == MACROSET_MAN)
(*curp->outman)(curp->outdata, man);
- if (mdoc && curp->outmdoc)
- (*curp->outmdoc)(curp->outdata, mdoc);
}
static void