aboutsummaryrefslogtreecommitdiff
path: root/src/xz/args.c
diff options
context:
space:
mode:
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];