changeset 12113:281617eccdf5

Remove the "lt-" prefix from program_invocation_short_name.
author Bruno Haible <bruno@clisp.org>
date Sun, 04 Oct 2009 12:14:52 +0200
parents e375e45551a4
children 8d87e8b9d237
files ChangeLog lib/progname.c modules/progname
diffstat 3 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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.
--- a/lib/progname.c
+++ b/lib/progname.c
@@ -48,7 +48,14 @@
     {
       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
--- a/modules/progname
+++ b/modules/progname
@@ -9,6 +9,7 @@
 
 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