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 9bb6d9464c3591488deb46fd17a5632f13c3a43d..425cd05a3167d966f5bd383fbffe626cded8bf61 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+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.
index 90baedaec271246ad9060d6bd83ab79cf80f62b3..bfa374a528b9ad338beb1b65ad82f9a528c953cb 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 0877801525054653064d5f90bef768ddd2f7c01a..349b1ff0a7c60d7a6c3717e4d4837978633c69a9 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