summaryrefslogtreecommitdiff
path: root/libc/misc/internals
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-01-04 00:46:31 +0000
committerMike Frysinger <vapier@gentoo.org>2006-01-04 00:46:31 +0000
commitcd662e64be1b10615e2fb44d5f3dc97eca905a31 (patch)
tree3ce4c8efdd7bd86c94c2cd55485be726921c950b /libc/misc/internals
parent2aa7788e7f161b9c51f3f5ec685b280fe42e380d (diff)
tweak __progname handling some more since some [bad] apps actually try and use it
Diffstat (limited to 'libc/misc/internals')
-rw-r--r--libc/misc/internals/__uClibc_main.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index 424d066bb..3876c7606 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -63,13 +63,15 @@ extern void weak_function _locale_init(void) attribute_hidden;
#ifdef __UCLIBC_HAS_THREADS__
extern void weak_function __pthread_initialize_minimal(void);
#endif
+
+attribute_hidden const char *__uclibc_progname = NULL;
+#ifdef __UCLIBC_HAS___PROGNAME__
+strong_alias (__uclibc_progname, __progname)
+#endif
#ifdef __UCLIBC_HAS_PROGRAM_INVOCATION_NAME__
-char *program_invocation_name = (char *) "";
-char *program_invocation_short_name = (char *) "";
-hidden_strong_alias (program_invocation_name, __progname_full)
-hidden_strong_alias (program_invocation_short_name, __progname)
-#else
-attribute_hidden const char *__progname = NULL;
+attribute_hidden const char *__progname_full = NULL;
+strong_alias (__uclibc_progname, program_invocation_short_name)
+strong_alias (__progname_full, program_invocation_name)
#endif
/*
@@ -261,16 +263,14 @@ __uClibc_main(int (*main)(int, char **, char **), int argc,
#endif
#ifdef __UCLIBC_HAS_PROGRAM_INVOCATION_NAME__
- if (likely(argv && argv[0])) {
- __progname_full = *argv;
- __progname = __strrchr(*argv, '/');
- if (__progname != NULL)
- ++__progname;
- else
- __progname = __progname_full;
- }
+ __progname_full = *argv;
+ __progname = __strrchr(*argv, '/');
+ if (__progname != NULL)
+ ++__progname;
+ else
+ __progname = __progname_full;
#else
- __progname = *argv;
+ __uclibc_progname = *argv;
#endif
#ifdef __UCLIBC_CTOR_DTOR__