summaryrefslogtreecommitdiff
path: root/tar
diff options
context:
space:
mode:
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>2012-02-20 17:14:57 +0900
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>2012-02-20 17:14:57 +0900
commit8eb4c87a87d4ae5e74848541460b366cabf863f2 (patch)
tree2be5452d306a83dc68a3083da7aa09dea1012000 /tar
parent43b15427b4e6879bfe3c0b7a673aa4f00b0b972e (diff)
downloadlibarchive-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.c4
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