From: schwarze@mandoc.bsd.lv
To: source@mandoc.bsd.lv
Subject: mandoc: avoid duplicate "bad argument" error message, also shortening
Date: Fri, 3 May 2019 13:40:04 -0500 (EST) [thread overview]
Message-ID: <e3fef723b33d86ba@fantadrom.bsd.lv> (raw)
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
reply other threads:[~2019-05-03 18:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e3fef723b33d86ba@fantadrom.bsd.lv \
--to=schwarze@mandoc.bsd.lv \
--cc=source@mandoc.bsd.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).