source@mandoc.bsd.lv
 help / color / 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, back to index

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

source@mandoc.bsd.lv

Archives are clonable: git clone --mirror http://inbox.vuxu.org/mandoc-source

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.mandoc.source


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git