diff options
author | Ron Yorston <rmy@pobox.com> | 2018-04-08 14:45:49 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2018-04-08 14:52:20 +0100 |
commit | 13fc352af9a47da92ac0198c7a862c722f143508 (patch) | |
tree | d4fb8ce34171ca0c3d3c8229dbb561238e1a8fa2 | |
parent | dbac0d1b489703d4a35571c3f231da8a95a5c12a (diff) | |
download | busybox-w32-13fc352af9a47da92ac0198c7a862c722f143508.tar.gz busybox-w32-13fc352af9a47da92ac0198c7a862c722f143508.tar.bz2 busybox-w32-13fc352af9a47da92ac0198c7a862c722f143508.zip |
win32: more backslash to slash conversions
Convert backslashes to slashes:
- in the main program's argv[0]
- in the shell's file argument
Also, fix the code to remove the .exe extension from argv[0] in
the main program.
-rw-r--r-- | libbb/appletlib.c | 3 | ||||
-rw-r--r-- | shell/ash.c | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c index 3e740363a..8fae11998 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c | |||
@@ -1150,7 +1150,8 @@ int main(int argc UNUSED_PARAM, char **argv) | |||
1150 | char *s; | 1150 | char *s; |
1151 | 1151 | ||
1152 | str_tolower(argv[0]); | 1152 | str_tolower(argv[0]); |
1153 | if (has_exe_suffix_or_dot(argv[0]) && !(s=strrchr(argv[0], '.'))) { | 1153 | convert_slashes(argv[0]); |
1154 | if (has_exe_suffix_or_dot(argv[0]) && (s=strrchr(argv[0], '.'))) { | ||
1154 | *s = '\0'; | 1155 | *s = '\0'; |
1155 | } | 1156 | } |
1156 | } | 1157 | } |
diff --git a/shell/ash.c b/shell/ash.c index ba05f073f..5ec035043 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -14593,6 +14593,9 @@ procargs(char **argv) | |||
14593 | goto setarg0; | 14593 | goto setarg0; |
14594 | } else if (!sflag) { | 14594 | } else if (!sflag) { |
14595 | setinputfile(*xargv, 0); | 14595 | setinputfile(*xargv, 0); |
14596 | #if ENABLE_PLATFORM_MINGW32 | ||
14597 | convert_slashes(*xargv); | ||
14598 | #endif | ||
14596 | setarg0: | 14599 | setarg0: |
14597 | arg0 = *xargv++; | 14600 | arg0 = *xargv++; |
14598 | commandname = arg0; | 14601 | commandname = arg0; |