=================================================================== RCS file: /cvs/mandoc/main.c,v retrieving revision 1.234 retrieving revision 1.236 diff -u -p -r1.234 -r1.236 --- mandoc/main.c 2015/04/18 16:06:40 1.234 +++ mandoc/main.c 2015/04/19 15:10:46 1.236 @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.234 2015/04/18 16:06:40 schwarze Exp $ */ +/* $Id: main.c,v 1.236 2015/04/19 15:10:46 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2012, 2014, 2015 Ingo Schwarze @@ -357,6 +357,8 @@ main(int argc, char *argv[]) argc, argv, &res, &sz); if (sz == 0) { + fprintf(stderr, "%s: nothing appropriate\n", + progname); rc = MANDOCLEVEL_BADARG; goto out; } @@ -632,7 +634,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 +721,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