summaryrefslogtreecommitdiff
path: root/libshouldbeinlibc/argp-parse.c
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1997-02-12 13:20:17 +0000
committerMiles Bader <miles@gnu.org>1997-02-12 13:20:17 +0000
commit25c7144ba51c57c415200c7f5f61d8b6815a40df (patch)
treeef5586d601af368145c42611a410123db18e20eb /libshouldbeinlibc/argp-parse.c
parent4ecfd51c7c1a546f3a89693fd24b006cc94a57b1 (diff)
(__progname, __progname_full):
Decls removed. (argp_default_parser): Use PROGRAM_INVOCATION_NAME & PROGRAM_INVOCATION_SHORT_NAME instead of __PROGNAME_FULL & __PROGNAME.
Diffstat (limited to 'libshouldbeinlibc/argp-parse.c')
-rw-r--r--libshouldbeinlibc/argp-parse.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/libshouldbeinlibc/argp-parse.c b/libshouldbeinlibc/argp-parse.c
index 2784e8d4..40cfc87f 100644
--- a/libshouldbeinlibc/argp-parse.c
+++ b/libshouldbeinlibc/argp-parse.c
@@ -34,8 +34,6 @@
#endif
#endif /* _LIBC */
-extern char *__progname, *__progname_full;
-
#include "argp.h"
#include "argp-namefrob.h"
@@ -94,20 +92,20 @@ argp_default_parser (int key, char *arg, struct argp_state *state)
break;
case OPT_PROGNAME: /* Set the program name. */
- __progname_full = arg;
+ program_invocation_name = arg;
- /* [Note that some systems only have __progname, in which
- __progname_full is just defined to be that, so we have to be a bit
- careful to take that into account here.] */
+ /* [Note that some systems only have PROGRAM_INVOCATION_SHORT_NAME (aka
+ __PROGNAME), in which case, PROGRAM_INVOCATION_NAME is just defined
+ to be that, so we have to be a bit careful here.] */
arg = strrchr (arg, '/');
if (arg)
- __progname = arg + 1;
+ program_invocation_short_name = arg + 1;
else
- __progname = __progname_full;
+ program_invocation_short_name = program_invocation_name;
if ((state->flags & (ARGP_PARSE_ARGV0 | ARGP_NO_ERRS))
== ARGP_PARSE_ARGV0)
- state->argv[0] = __progname_full; /* Update what getopt uses too. */
+ state->argv[0] = program_invocation_name; /* Update what getopt uses too. */
break;
@@ -538,7 +536,7 @@ parser_init (struct parser *parser, const struct argp *argp,
/* There's an argv[0]; use it for messages. */
parser->state.name = argv[0];
else
- parser->state.name = __progname_full;
+ parser->state.name = program_invocation_name;
/* Getopt is (currently) non-reentrant. */
LOCK_GETOPT;