diff options
author | Bruno Haible <bruno@clisp.org> | 2001-10-30 11:08:14 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2001-10-30 11:08:14 +0000 |
commit | 93be4ee5621f8321054ac546ae3927d4d63984b6 (patch) | |
tree | fc7dd7f529e76f34760e170948ea0c5e86390c7c /lib/progname.c | |
parent | 49b9da8ee43a4630dfacac65b2d356c0f2b42906 (diff) | |
download | external_gettext-93be4ee5621f8321054ac546ae3927d4d63984b6.zip external_gettext-93be4ee5621f8321054ac546ae3927d4d63984b6.tar.gz external_gettext-93be4ee5621f8321054ac546ae3927d4d63984b6.tar.bz2 |
Improve program_name on BeOS.
Diffstat (limited to 'lib/progname.c')
-rw-r--r-- | lib/progname.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/progname.c b/lib/progname.c index 78d40cb..6f48a21 100644 --- a/lib/progname.c +++ b/lib/progname.c @@ -39,8 +39,19 @@ set_program_name (argv0) { /* libtool creates a temporary executable whose name is prefixed with "lt-". Remove this prefix here. */ +#ifdef __BEOS__ + /* BeOS also makes argv[0] absolute. Remove a leading "<dirname>/lt-". */ + const char *slash; + const char *base; + + slash = strrchr (argv0, '/'); + base = (slash != NULL ? slash + 1 : argv0); + if (strncmp (base, "lt-", 3) == 0) + argv0 = base + 3; +#else if (strncmp (argv0, "lt-", 3) == 0) argv0 += 3; +#endif program_name = argv0; } |