aboutsummaryrefslogtreecommitdiff
path: root/src/xz/args.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2009-02-13 17:29:02 +0200
committerLasse Collin <lasse.collin@tukaani.org>2009-02-13 17:29:02 +0200
commit96c46df7deb231ea68a03d8d1da9de4c774e36d8 (patch)
tree6788af6a63bd9bdc77f318b7581b43e859e1a44c /src/xz/args.c
parentRemove dead directories from .gitignore. (diff)
downloadxz-96c46df7deb231ea68a03d8d1da9de4c774e36d8.tar.xz
Improve support for DOS-like systems.
Here DOS-like means DOS, Windows, and OS/2.
Diffstat (limited to 'src/xz/args.c')
-rw-r--r--src/xz/args.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/xz/args.c b/src/xz/args.c
index 93cd220a..31ff0e58 100644
--- a/src/xz/args.c
+++ b/src/xz/args.c
@@ -424,15 +424,12 @@ args_parse(args_info *args, int argc, char **argv)
// Check how we were called.
{
- // Remove the leading path name, if any.
-#ifdef _WIN32
- // Some systems support both / and \ to separate path
- // components.
- const char *name = argv[0] + strlen(argv[0]);
- while (argv[0] < name && name[-1] != '/' && name[-1] != '\\')
- --name;
+#ifdef DOSLIKE
+ // We adjusted argv[0] in the beginning of main() so we don't
+ // need to do anything here.
+ const char *name = argv[0];
#else
- // POSIX
+ // Remove the leading path name, if any.
const char *name = strrchr(argv[0], '/');
if (name == NULL)
name = argv[0];