summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--lib/progname.c9
-rw-r--r--modules/progname1
3 files changed, 17 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 9bb6d9464c..425cd05a31 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2009-10-04 Bruno Haible <bruno@clisp.org>
+ * lib/progname.c (set_program_name): Also remove the "lt-" prefix from
+ program_invocation_short_name.
+ * modules/progname (configure.ac): Test for presence of
+ program_invocation_short_name.
+ Reported by Sergey Poznyakoff <gray@gnu.org.ua>.
+
+2009-10-04 Bruno Haible <bruno@clisp.org>
+
* lib/progname.c (set_program_name): Fix comment.
Reported by Jim Meyering.
diff --git a/lib/progname.c b/lib/progname.c
index 90baedaec2..bfa374a528 100644
--- a/lib/progname.c
+++ b/lib/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
diff --git a/modules/progname b/modules/progname
index 0877801525..349b1ff0a7 100644
--- a/modules/progname
+++ b/modules/progname
@@ -9,6 +9,7 @@ Depends-on:
configure.ac:
AC_CHECK_DECLS([program_invocation_name], [], [], [#include <errno.h>])
+AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include <errno.h>])
Makefile.am:
lib_SOURCES += progname.h progname.c