+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.
{
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
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