summaryrefslogtreecommitdiff
path: root/gl/progname.c
diff options
context:
space:
mode:
Diffstat (limited to 'gl/progname.c')
-rw-r--r--gl/progname.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/gl/progname.c b/gl/progname.c
index 19df10ad71..bfa374a528 100644
--- a/gl/progname.c
+++ b/gl/progname.c
@@ -48,7 +48,14 @@ set_program_name (const char *argv0)
{
argv0 = base;
if (strncmp (base, "lt-", 3) == 0)
- argv0 = base + 3;
+ {
+ argv0 = base + 3;
+ /* On glibc systems, remove the "lt-" prefix from the variable
+ program_invocation_short_name. */
+#if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
+ program_invocation_short_name = (char *) argv0;
+#endif
+ }
}
/* But don't strip off a leading <dirname>/ in general, because when the user
@@ -62,9 +69,9 @@ set_program_name (const char *argv0)
program_name = argv0;
- /* On glibc systems, when the gnulib module 'error' is not used, the error()
- function comes from libc and uses the variable program_invocation_name,
- not program_name. So set this variable as well. */
+ /* On glibc systems, the error() function comes from libc and uses the
+ variable program_invocation_name, not program_name. So set this variable
+ as well. */
#if HAVE_DECL_PROGRAM_INVOCATION_NAME
program_invocation_name = (char *) argv0;
#endif