]> Savannah Git Hosting - gnulib.git/commitdiff
progname: also set program_invocation_short_name
authorPádraig Brady <P@draigBrady.com>
Sun, 12 Jan 2025 16:47:57 +0000 (16:47 +0000)
committerPádraig Brady <P@draigBrady.com>
Sun, 12 Jan 2025 19:56:25 +0000 (19:56 +0000)
* lib/progname.c (set_program_name): Keep program_invocation_name
and program_invocation_short_name consistent.

ChangeLog
lib/progname.c

index 6ccd999e80729c27ab7c03c735205f64c00578cb..b52a2799b9b3629c4d940e385ec1225f16a3e967 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-01-12  Pádraig Brady  <P@draigBrady.com>
+
+       progname: also set program_invocation_short_name
+       * lib/progname.c (set_program_name): Keep program_invocation_name
+       and program_invocation_short_name consistent.
+
 2025-01-11  Pádraig Brady  <P@draigBrady.com>
 
        file-has-acl: handle NFSv4 ACLs with listxattr returning EACCES
index ee62489285bb67431c7ec1204899799173dcf57e..4a45ca349089f3ca43d3d12e722ae574c1a37448 100644 (file)
@@ -63,12 +63,8 @@ set_program_name (const char *argv0)
       argv0 = base;
       if (strncmp (base, "lt-", 3) == 0)
         {
-          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
+          base += 3;
+          argv0 = base;
         }
     }
 
@@ -89,4 +85,7 @@ set_program_name (const char *argv0)
 #if HAVE_DECL_PROGRAM_INVOCATION_NAME
   program_invocation_name = (char *) argv0;
 #endif
+#if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
+  program_invocation_short_name = (char *) base;
+#endif
 }