* mdocml: if earlier files set a non-zero exit status, do not allow later
@ 2015-01-14 21:27 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2015-01-14 21:27 UTC (permalink / raw)
To: source
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-01-14 21:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-14 21:27 mdocml: if earlier files set a non-zero exit status, do not allow later schwarze
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).