convert to use getprogname()
This commit is contained in:
parent
6b25d77513
commit
668a4dd967
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: chio.c,v 1.14 1999/09/09 23:32:10 thorpej Exp $ */
|
||||
/* $NetBSD: chio.c,v 1.15 2001/02/19 22:39:39 cgd Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996, 1998, 1999 The NetBSD Foundation, Inc.
|
||||
|
@ -46,7 +46,7 @@
|
|||
__COPYRIGHT(
|
||||
"@(#) Copyright (c) 1996, 1998, 1999\
|
||||
The NetBSD Foundation, Inc. All rights reserved.");
|
||||
__RCSID("$NetBSD: chio.c,v 1.14 1999/09/09 23:32:10 thorpej Exp $");
|
||||
__RCSID("$NetBSD: chio.c,v 1.15 2001/02/19 22:39:39 cgd Exp $");
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -66,8 +66,6 @@ __RCSID("$NetBSD: chio.c,v 1.14 1999/09/09 23:32:10 thorpej Exp $");
|
|||
#include "defs.h"
|
||||
#include "pathnames.h"
|
||||
|
||||
extern const char *__progname; /* from crt0.o */
|
||||
|
||||
int main __P((int, char *[]));
|
||||
static void usage __P((void));
|
||||
static void cleanup __P((void));
|
||||
|
@ -854,7 +852,8 @@ usage()
|
|||
{
|
||||
int i;
|
||||
|
||||
(void) fprintf(stderr, "Usage: %s command arg1 arg2 ...\n", __progname);
|
||||
(void) fprintf(stderr, "Usage: %s command arg1 arg2 ...\n",
|
||||
getprogname());
|
||||
|
||||
(void) fprintf(stderr, "Where command (and args) are:\n");
|
||||
for (i = 0; commands[i].cc_name != NULL; i++)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ln.c,v 1.17 2001/02/04 19:32:26 christos Exp $ */
|
||||
/* $NetBSD: ln.c,v 1.18 2001/02/19 22:39:39 cgd Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1987, 1993, 1994
|
||||
|
@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 1993, 1994\n\
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)ln.c 8.2 (Berkeley) 3/31/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: ln.c,v 1.17 2001/02/04 19:32:26 christos Exp $");
|
||||
__RCSID("$NetBSD: ln.c,v 1.18 2001/02/19 22:39:39 cgd Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -63,8 +63,6 @@ int sflag; /* Symbolic, not hard, link. */
|
|||
/* System link call. */
|
||||
int (*linkf) __P((const char *, const char *));
|
||||
|
||||
extern char *__progname;
|
||||
|
||||
int linkit __P((char *, char *, int));
|
||||
void usage __P((void));
|
||||
int main __P((int, char *[]));
|
||||
|
@ -177,7 +175,7 @@ usage()
|
|||
|
||||
(void)fprintf(stderr,
|
||||
"Usage:\t%s [-fhns] file1 file2\n\t%s [-fhns] file ... directory\n",
|
||||
__progname, __progname);
|
||||
getprogname(), getprogname());
|
||||
exit(1);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: gzip.c,v 1.2 2001/01/04 16:17:15 lukem Exp $ */
|
||||
/* $NetBSD: gzip.c,v 1.3 2001/02/19 22:40:52 cgd Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997, 1998 Matthew R. Green
|
||||
|
@ -55,8 +55,6 @@
|
|||
|
||||
#define BUFLEN 4096
|
||||
|
||||
extern char *__progname; /* XXX */
|
||||
|
||||
static char gzip_version[] = "NetBSD gzip 1.0";
|
||||
|
||||
static char gzipflags[3] = ""; /* `w' or `r', possible with [1-9] */
|
||||
|
@ -94,6 +92,7 @@ main(argc, argv)
|
|||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
const char *progname = getprogname();
|
||||
int ch;
|
||||
|
||||
gzipflags[0] = 'w';
|
||||
|
@ -103,10 +102,10 @@ main(argc, argv)
|
|||
* XXX
|
||||
* handle being called `gunzip', `zcat' and `gzcat'
|
||||
*/
|
||||
if (strcmp(__progname, "gunzip") == 0)
|
||||
if (strcmp(progname, "gunzip") == 0)
|
||||
dflag = 1;
|
||||
else if (strcmp(__progname, "zcat") == 0 ||
|
||||
strcmp(__progname, "gzcat") == 0)
|
||||
else if (strcmp(progname, "zcat") == 0 ||
|
||||
strcmp(progname, "gzcat") == 0)
|
||||
dflag = cflag = 1;
|
||||
|
||||
while ((ch = getopt(argc, argv, "cdfhnqrS:tvV123456789")) != -1)
|
||||
|
@ -625,7 +624,7 @@ usage()
|
|||
|
||||
fprintf(stderr,
|
||||
"Usage: %s [-cdfhnqrtVv123456789] [<file> [<file> ...]]\n",
|
||||
__progname);
|
||||
getprogname());
|
||||
fflush(stderr);
|
||||
exit(0);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: arithmetic.c,v 1.16 2001/02/05 00:20:58 christos Exp $ */
|
||||
/* $NetBSD: arithmetic.c,v 1.17 2001/02/19 22:41:45 cgd Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
|
@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)arithmetic.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: arithmetic.c,v 1.16 2001/02/05 00:20:58 christos Exp $");
|
||||
__RCSID("$NetBSD: arithmetic.c,v 1.17 2001/02/19 22:41:45 cgd Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -106,8 +106,6 @@ int nright, nwrong;
|
|||
time_t qtime;
|
||||
#define NQUESTS 20
|
||||
|
||||
extern char *__progname; /* from crt0.o */
|
||||
|
||||
/*
|
||||
* Select keys from +-x/ to be asked addition, subtraction, multiplication,
|
||||
* and division problems. More than one key may be given. The default is
|
||||
|
@ -389,6 +387,6 @@ void
|
|||
usage()
|
||||
{
|
||||
(void)fprintf(stderr, "Usage: %s [-o +-x/] [-r range]\n",
|
||||
__progname);
|
||||
getprogname());
|
||||
exit(1);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: fortune.c,v 1.26 2001/02/05 00:29:44 christos Exp $ */
|
||||
/* $NetBSD: fortune.c,v 1.27 2001/02/19 22:41:45 cgd Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1986, 1993
|
||||
|
@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1986, 1993\n\
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)fortune.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: fortune.c,v 1.26 2001/02/05 00:29:44 christos Exp $");
|
||||
__RCSID("$NetBSD: fortune.c,v 1.27 2001/02/19 22:41:45 cgd Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -206,8 +206,6 @@ regex_t *Re_pat = NULL;
|
|||
#define NAMLEN(d) ((d)->d_namlen)
|
||||
#endif
|
||||
|
||||
extern char *__progname;
|
||||
|
||||
int
|
||||
main(ac, av)
|
||||
int ac;
|
||||
|
@ -1357,7 +1355,8 @@ matches_in_list(list)
|
|||
void
|
||||
usage()
|
||||
{
|
||||
(void) fprintf(stderr, "Usage: %s [-a", __progname);
|
||||
|
||||
(void) fprintf(stderr, "Usage: %s [-a", getprogname());
|
||||
#ifdef DEBUG
|
||||
(void) fprintf(stderr, "D");
|
||||
#endif /* DEBUG */
|
||||
|
|
Loading…
Reference in New Issue