diff options
author | 2019-05-03 18:38:44 +0000 | |
---|---|---|
committer | 2019-05-03 18:38:44 +0000 | |
commit | bbfeca9f52fbd6b3b00208367074a5b24eb8e412 (patch) | |
tree | 793c8423f416723bb86d073e0cb448547ddc692a | |
parent | Enter dangling .so links into the database, to avoid harassing (diff) | |
download | wireguard-openbsd-bbfeca9f52fbd6b3b00208367074a5b24eb8e412.tar.xz wireguard-openbsd-bbfeca9f52fbd6b3b00208367074a5b24eb8e412.zip |
avoid duplicate "bad argument" error message, also shortening the code
-rw-r--r-- | usr.bin/mandoc/main.c | 9 | ||||
-rw-r--r-- | usr.bin/mandoc/manpath.c | 5 |
2 files changed, 5 insertions, 9 deletions
diff --git a/usr.bin/mandoc/main.c b/usr.bin/mandoc/main.c index a63db1f5d8f..5a3721a1d23 100644 --- a/usr.bin/mandoc/main.c +++ b/usr.bin/mandoc/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.228 2019/05/03 17:31:05 schwarze Exp $ */ +/* $OpenBSD: main.c,v 1.229 2019/05/03 18:38:44 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2012, 2014-2019 Ingo Schwarze <schwarze@openbsd.org> @@ -276,12 +276,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; } } } diff --git a/usr.bin/mandoc/manpath.c b/usr.bin/mandoc/manpath.c index dac24a293bc..2e5ffcb15e5 100644 --- a/usr.bin/mandoc/manpath.c +++ b/usr.bin/mandoc/manpath.c @@ -1,4 +1,4 @@ -/* $OpenBSD: manpath.c,v 1.25 2019/05/03 17:45:17 anton Exp $ */ +/* $OpenBSD: manpath.c,v 1.26 2019/05/03 18:38:45 schwarze Exp $ */ /* * Copyright (c) 2011,2014,2015,2017,2018 Ingo Schwarze <schwarze@openbsd.org> * Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> @@ -332,8 +332,7 @@ manconf_output(struct manoutput *conf, const char *cp, int fromfile) 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) |