aboutsummaryrefslogtreecommitdiff
path: root/win32/process.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2019-03-15 10:27:19 +0000
committerRon Yorston <rmy@pobox.com>2019-03-15 10:27:19 +0000
commit996f93243dda87de3140c497624312722f47ffa1 (patch)
tree8c894b5b7414cbd72f02bd309d54ffa62283915a /win32/process.c
parent79c85ec59075b5ead415a4713bd72445546dcf8e (diff)
downloadbusybox-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 'win32/process.c')
-rw-r--r--win32/process.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/win32/process.c b/win32/process.c
index d0fcc1c80..99db6f79f 100644
--- a/win32/process.c
+++ b/win32/process.c
@@ -190,7 +190,7 @@ static intptr_t
190spawnveq(int mode, const char *path, char *const *argv, char *const *env) 190spawnveq(int mode, const char *path, char *const *argv, char *const *env)
191{ 191{
192 char **new_argv; 192 char **new_argv;
193 char *s, *new_path = NULL; 193 char *new_path = NULL;
194 int i, argc; 194 int i, argc;
195 intptr_t ret; 195 intptr_t ret;
196 struct stat st; 196 struct stat st;
@@ -219,10 +219,7 @@ spawnveq(int mode, const char *path, char *const *argv, char *const *env)
219 * argument is a relative path containing forward slashes. Absolute 219 * argument is a relative path containing forward slashes. Absolute
220 * paths are fine but there's no harm in converting them too. */ 220 * paths are fine but there's no harm in converting them too. */
221 if (has_bat_suffix(path)) { 221 if (has_bat_suffix(path)) {
222 for (s=new_argv[0]; *s; ++s) { 222 slash_to_bs(new_argv[0]);
223 if (*s == '/')
224 *s = '\\';
225 }
226 223
227 /* Another special case: spawnve returns ENOEXEC when passed an 224 /* Another special case: spawnve returns ENOEXEC when passed an
228 * empty batch file. Pretend it worked. */ 225 * empty batch file. Pretend it worked. */