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 1ba27b43 for ; Fri, 3 May 2019 13:40:04 -0500 (EST) Date: Fri, 3 May 2019 13:40:04 -0500 (EST) X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: mandoc: avoid duplicate "bad argument" error message, also shortening X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-ID: Log Message: ----------- avoid duplicate "bad argument" error message, also shortening the code Modified Files: -------------- mandoc: main.c manpath.c Revision Data ------------- Index: main.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/main.c,v retrieving revision 1.326 retrieving revision 1.327 diff -Lmain.c -Lmain.c -u -p -r1.326 -r1.327 --- main.c +++ main.c @@ -300,12 +300,9 @@ main(int argc, char *argv[]) search.outkey = oarg; else { while (oarg != NULL) { - thisarg = oarg; if (manconf_output(&conf.output, - strsep(&oarg, ","), 0) == 0) - continue; - warnx("-O %s: Bad argument", thisarg); - return (int)MANDOCLEVEL_BADARG; + strsep(&oarg, ","), 0) == -1) + return (int)MANDOCLEVEL_BADARG; } } } Index: manpath.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/manpath.c,v retrieving revision 1.38 retrieving revision 1.39 diff -Lmanpath.c -Lmanpath.c -u -p -r1.38 -r1.39 --- manpath.c +++ manpath.c @@ -332,8 +332,7 @@ manconf_output(struct manoutput *conf, c conf->toc = 1; return 0; default: - if (fromfile) - warnx("-O %s: Bad argument", cp); + warnx("-O %s: Bad argument", cp); return -1; } if (fromfile == 0) -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv