# HG changeset patch # User Sergey Poznyakoff # Date 1157888968 0 # Node ID ec5559fba282c0fdcd289573103d2cb6b6c3c455 # Parent ac08c25fd65ac29589364662cac51dfd9ff2eba3 (__argp_parse) [!_LIBC]: Make sure program_invocation_name and program_invocation_short_name are initialized. diff --git a/lib/argp-parse.c b/lib/argp-parse.c --- a/lib/argp-parse.c +++ b/lib/argp-parse.c @@ -877,6 +877,20 @@ to be parsed (which in some cases isn't actually an error). */ int arg_ebadkey = 0; +#ifndef _LIBC + if (!(flags & ARGP_PARSE_ARGV0)) + { +#ifdef HAVE_DECL_PROGRAM_INVOCATION_NAME + if (!program_invocation_name) + program_invocation_name = argv[0]; +#endif +#ifdef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME + if (!program_invocation_short_name) + program_invocation_short_name = __argp_base_name (argv[0]); +#endif + } +#endif + if (! (flags & ARGP_NO_HELP)) /* Add our own options. */ {