Do not use argv[0] in usage().

This commit is contained in:
charnier 1997-07-01 06:37:34 +00:00
parent 392cc87247
commit cce3170ff8

View File

@ -24,7 +24,7 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
/* $Id$ */ /* $Id: main.c,v 1.38 1997/02/22 19:54:57 peter Exp $ */
#include <sys/types.h> #include <sys/types.h>
@ -49,11 +49,11 @@ static sigjmp_buf sigbuf;
static int get(struct fetch_state *volatile fs); static int get(struct fetch_state *volatile fs);
static void static void
usage(const char *argv0) usage()
{ {
fprintf(stderr, fprintf(stderr, "%s\n%s\n",
"%s: usage:\n\t%s [-DHILMNPRTValmnpqrv] [-o outputfile] " "usage: fetch [-DHILMNPRTValmnpqrv] [-o outputfile]",
"[-f file -h host [-c dir] | URL]\n", argv0, argv0); " [-f file -h host [-c dir] | URL]\n");
exit(EX_USAGE); exit(EX_USAGE);
} }
@ -144,7 +144,7 @@ main(int argc, char *const *argv)
default: default:
case '?': case '?':
usage(argv[0]); usage();
} }
} }
@ -152,7 +152,7 @@ main(int argc, char *const *argv)
if (argv[optind] && (hostname || change_to_dir || file_to_get)) { if (argv[optind] && (hostname || change_to_dir || file_to_get)) {
warnx("cannot use -h, -c, or -f with a URI argument"); warnx("cannot use -h, -c, or -f with a URI argument");
usage(argv[0]); usage();
} }
if (fs.fs_mirror && fs.fs_restart) if (fs.fs_mirror && fs.fs_restart)
@ -164,7 +164,7 @@ main(int argc, char *const *argv)
if (hostname == 0) hostname = "localhost"; if (hostname == 0) hostname = "localhost";
if (change_to_dir == 0) change_to_dir = ""; if (change_to_dir == 0) change_to_dir = "";
if (file_to_get == 0) { if (file_to_get == 0) {
usage(argv[0]); usage();
} }
uri = alloca(sizeof("ftp://") + strlen(hostname) + uri = alloca(sizeof("ftp://") + strlen(hostname) +