Remove the "lt-" prefix from program_invocation_short_name.
authorBruno Haible <bruno@clisp.org>
Sun, 4 Oct 2009 10:14:52 +0000 (12:14 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 4 Oct 2009 10:14:52 +0000 (12:14 +0200)
ChangeLog
lib/progname.c
modules/progname

index 9bb6d94..425cd05 100644 (file)
--- 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.
 
index 90baeda..bfa374a 100644 (file)
@@ -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
index 0877801..349b1ff 100644 (file)
@@ -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