From: Bruno Haible Date: Fri, 2 May 2003 10:20:37 +0000 (+0000) Subject: Tweak for libtool=1.5 behaviour on HP-UX. X-Git-Tag: v0.12~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be1b282cc1ed80c3f122870f4ffee6a66c760ccc;p=thirdparty%2Fgettext.git Tweak for libtool=1.5 behaviour on HP-UX. --- diff --git a/gettext-tools/lib/ChangeLog b/gettext-tools/lib/ChangeLog index 6be89207c..1c4507cd1 100644 --- a/gettext-tools/lib/ChangeLog +++ b/gettext-tools/lib/ChangeLog @@ -1,8 +1,8 @@ -2003-04-24 Bruno Haible +2003-05-02 Bruno Haible Support for libtool-1.5. - * progname.c (set_program_name): Remove a leading "/lt-", - not only "lt-". + * progname.c (set_program_name): Remove a leading "/.libs/lt-" + or "/.libs/", not only "lt-". 2003-04-12 Bruno Haible diff --git a/gettext-tools/lib/progname.c b/gettext-tools/lib/progname.c index 03913c840..ff8424524 100644 --- a/gettext-tools/lib/progname.c +++ b/gettext-tools/lib/progname.c @@ -38,14 +38,16 @@ const char *program_name; void set_program_name (const char *argv0) { - /* libtool creates a temporary executable whose name is prefixed with - "lt-". It also makes argv[0] absolute. Remove this "/lt-" - prefix here. */ + /* libtool creates a temporary executable whose name is sometimes prefixed + with "lt-" (depends on the platform). It also makes argv[0] absolute. + Remove this "/.libs/" or "/.libs/lt-" prefix here. */ const char *slash; const char *base; slash = strrchr (argv0, '/'); base = (slash != NULL ? slash + 1 : argv0); + if (base - argv0 >= 7 && memcmp (base - 7, "/.libs/", 7) == 0) + argv0 = base; if (strncmp (base, "lt-", 3) == 0) argv0 = base + 3; program_name = argv0;