diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-04-18 16:34:25 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-04-18 16:34:25 +0000 |
commit | 70a9dbd1a5a305812354c332d729472bd2c06561 (patch) | |
tree | 063eba43441d0af27e5bfb6e4db4bd1ce0c4e545 /main.c | |
parent | 90913383a1a42f4ed3816d5206553df9db14e839 (diff) | |
download | mandoc-70a9dbd1a5a305812354c332d729472bd2c06561.tar.gz mandoc-70a9dbd1a5a305812354c332d729472bd2c06561.tar.zst mandoc-70a9dbd1a5a305812354c332d729472bd2c06561.zip |
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.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.234 2015/04/18 16:06:40 schwarze Exp $ */ +/* $Id: main.c,v 1.235 2015/04/18 16:34:25 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2012, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org> @@ -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 |