diff options
author | Ron Yorston <rmy@pobox.com> | 2019-03-15 10:27:19 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2019-03-15 10:27:19 +0000 |
commit | 996f93243dda87de3140c497624312722f47ffa1 (patch) | |
tree | 8c894b5b7414cbd72f02bd309d54ffa62283915a /loginutils | |
parent | 79c85ec59075b5ead415a4713bd72445546dcf8e (diff) | |
download | busybox-w32-996f93243dda87de3140c497624312722f47ffa1.tar.gz busybox-w32-996f93243dda87de3140c497624312722f47ffa1.tar.bz2 busybox-w32-996f93243dda87de3140c497624312722f47ffa1.zip |
win32: add function to convert slashes to backslashes
There are now two places where slashes are converted to backslashes
throughout a string so it makes sense to create a function to do
this.
To avoid confusion rename convert_slashes() to bs_to_slash() and
call the new function slash_to_bs().
Diffstat (limited to 'loginutils')
-rw-r--r-- | loginutils/suw32.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/loginutils/suw32.c b/loginutils/suw32.c index e3c6d8744..de29f423a 100644 --- a/loginutils/suw32.c +++ b/loginutils/suw32.c | |||
@@ -28,18 +28,15 @@ int suw32_main(int argc UNUSED_PARAM, char **argv) | |||
28 | { | 28 | { |
29 | char *opt_command = NULL; | 29 | char *opt_command = NULL; |
30 | SHELLEXECUTEINFO info; | 30 | SHELLEXECUTEINFO info; |
31 | char *bb_path, *cwd, *s; | 31 | char *bb_path, *cwd; |
32 | 32 | ||
33 | getopt32(argv, "c:", &opt_command); | 33 | getopt32(argv, "c:", &opt_command); |
34 | if (argv[optind]) | 34 | if (argv[optind]) |
35 | bb_show_usage(); | 35 | bb_show_usage(); |
36 | 36 | ||
37 | /* ShellExecuteEx() needs backslash as separator in UNC paths. */ | 37 | /* ShellExecuteEx() needs backslash as separator in UNC paths. */ |
38 | bb_path = s = xstrdup(bb_busybox_exec_path); | 38 | bb_path = xstrdup(bb_busybox_exec_path); |
39 | for ( ; *s; ++s) { | 39 | slash_to_bs(bb_path); |
40 | if (*s == '/') | ||
41 | *s = '\\'; | ||
42 | } | ||
43 | 40 | ||
44 | memset(&info, 0, sizeof(SHELLEXECUTEINFO)); | 41 | memset(&info, 0, sizeof(SHELLEXECUTEINFO)); |
45 | info.cbSize = sizeof(SHELLEXECUTEINFO); | 42 | info.cbSize = sizeof(SHELLEXECUTEINFO); |