From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]); by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id 31768032; for ; Wed, 14 Jan 2015 16:27:48 -0500 (EST) Date: Wed, 14 Jan 2015 16:27:48 -0500 (EST) Message-Id: <18150979718847311339.enqueue@fantadrom.bsd.lv> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: if earlier files set a non-zero exit status, do not allow later X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- if earlier files set a non-zero exit status, do not allow later files to reset it to zero Modified Files: -------------- mdocml: main.c Revision Data ------------- Index: main.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/main.c,v retrieving revision 1.213 retrieving revision 1.214 diff -Lmain.c -Lmain.c -u -p -r1.213 -r1.214 --- main.c +++ main.c @@ -131,7 +131,7 @@ main(int argc, char *argv[]) int prio, best_prio, synopsis_only; char sec; #endif - enum mandoclevel rc; + enum mandoclevel rc, rctmp; enum outmode outmode; int fd; int show_usage; @@ -431,11 +431,13 @@ main(int argc, char *argv[]) } while (argc) { - rc = mparse_open(curp.mp, &fd, + rctmp = mparse_open(curp.mp, &fd, #if HAVE_SQLITE3 resp != NULL ? resp->file : #endif *argv); + if (rc < rctmp) + rc = rctmp; if (fd != -1) { if (use_pager && isatty(STDOUT_FILENO)) @@ -451,13 +453,17 @@ main(int argc, char *argv[]) /* For .so only; ignore failure. */ chdir(paths.paths[resp->ipath]); parse(&curp, fd, resp->file, &rc); - } else - rc = passthrough(resp->file, fd, + } else { + rctmp = passthrough(resp->file, fd, synopsis_only); + if (rc < rctmp) + rc = rctmp; + } #endif - if (mparse_wait(curp.mp) != MANDOCLEVEL_OK) - rc = MANDOCLEVEL_SYSERR; + rctmp = mparse_wait(curp.mp); + if (rc < rctmp) + rc = rctmp; if (argc > 1 && curp.outtype <= OUTT_UTF8) ascii_sepline(curp.outdata); -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv