changeset 9577:0b6c2edb43b3

Don't strip off a leading "lt-" prefix outside a .libs directory.
author Bruno Haible <bruno@clisp.org>
date Tue, 08 Jan 2008 02:16:21 +0100
parents 8cae100b8cd1
children d9a4ee65068a
files ChangeLog lib/progname.c
diffstat 2 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-01-07  Bruno Haible  <bruno@clisp.org>
+
+	* lib/progname.c (set_program_name): Don't strip off a leading
+	"lt-" prefix outside a .libs directory.
+	Suggested by Paul Eggert.
+
 2008-01-01  Sylvain Beucler  <beuc@gnu.org>
             Bruno Haible  <bruno@clisp.org>
 
--- a/lib/progname.c
+++ b/lib/progname.c
@@ -1,5 +1,5 @@
 /* Program name management.
-   Copyright (C) 2001-2003, 2005-2007 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2005-2008 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -42,8 +42,10 @@
   slash = strrchr (argv0, '/');
   base = (slash != NULL ? slash + 1 : argv0);
   if (base - argv0 >= 7 && strncmp (base - 7, "/.libs/", 7) == 0)
-    argv0 = base;
-  if (strncmp (base, "lt-", 3) == 0)
-    argv0 = base + 3;
+    {
+      argv0 = base;
+      if (strncmp (base, "lt-", 3) == 0)
+	argv0 = base + 3;
+    }
   program_name = argv0;
 }