utimens: remove invalid futimesat call
[gnulib.git] / lib / progname.c
index 19df10a..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
@@ -62,9 +69,9 @@ set_program_name (const char *argv0)
 
   program_name = argv0;
 
-  /* On glibc systems, when the gnulib module 'error' is not used, the error()
-     function comes from libc and uses the variable program_invocation_name,
-     not program_name.  So set this variable as well.  */
+  /* On glibc systems, the error() function comes from libc and uses the
+     variable program_invocation_name, not program_name.  So set this variable
+     as well.  */
 #if HAVE_DECL_PROGRAM_INVOCATION_NAME
   program_invocation_name = (char *) argv0;
 #endif