diff options
author | Michihiro NAKAJIMA <ggcueroad@gmail.com> | 2012-02-20 17:14:57 +0900 |
---|---|---|
committer | Michihiro NAKAJIMA <ggcueroad@gmail.com> | 2012-02-20 17:14:57 +0900 |
commit | 8eb4c87a87d4ae5e74848541460b366cabf863f2 (patch) | |
tree | 2be5452d306a83dc68a3083da7aa09dea1012000 /tar | |
parent | 43b15427b4e6879bfe3c0b7a673aa4f00b0b972e (diff) | |
download | libarchive-8eb4c87a87d4ae5e74848541460b366cabf863f2.tar.gz |
On Windows, it is possible that the program name should have a slash '/'
character not only a backslash '\' character. We have to check both
a slash and a backslash to get the running program name of bsdcpio or
bsdtar.
Diffstat (limited to 'tar')
-rw-r--r-- | tar/bsdtar.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tar/bsdtar.c b/tar/bsdtar.c index 52b5c91b..b92ada1e 100644 --- a/tar/bsdtar.c +++ b/tar/bsdtar.c @@ -179,9 +179,9 @@ main(int argc, char **argv) else { #if defined(_WIN32) && !defined(__CYGWIN__) lafe_progname = strrchr(*argv, '\\'); -#else - lafe_progname = strrchr(*argv, '/'); + if (strrchr(*argv, '/') > lafe_progname) #endif + lafe_progname = strrchr(*argv, '/'); if (lafe_progname != NULL) lafe_progname++; else |