source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mandoc: avoid duplicate "bad argument" error message, also shortening
@ 2019-05-03 18:40 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2019-05-03 18:40 UTC (permalink / raw)
  To: source

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-05-03 18:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-03 18:40 mandoc: avoid duplicate "bad argument" error message, also shortening 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).