aboutsummaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2020-03-29 12:39:30 +0100
committerRon Yorston <rmy@pobox.com>2020-03-29 12:39:30 +0100
commitbeff2721928fdb624c227cccd15bde7ae68862e3 (patch)
treeaab737745fbe04069fa7afd1d20bb779c8424237 /win32
parent4ddcb317ac954cc371a86d5873ee231c3b8684ec (diff)
downloadbusybox-w32-beff2721928fdb624c227cccd15bde7ae68862e3.tar.gz
busybox-w32-beff2721928fdb624c227cccd15bde7ae68862e3.tar.bz2
busybox-w32-beff2721928fdb624c227cccd15bde7ae68862e3.zip
win32: more improvements to 'c:file' paths
Tab-completion of 'c:file' paths was leaking memory and incorrectly included BusyBox applets and shell built-ins. Fix handling of 'c:file' paths used as arguments to spawn functions. Otherwise things like 'timeout 5 c:busybox sleep 99' don't work.
Diffstat (limited to 'win32')
-rw-r--r--win32/process.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/win32/process.c b/win32/process.c
index 8546c6e2f..4257fd689 100644
--- a/win32/process.c
+++ b/win32/process.c
@@ -320,8 +320,9 @@ mingw_spawn_1(int mode, const char *cmd, char *const *argv, char *const *envp)
320 return mingw_spawn_applet(mode, argv, envp); 320 return mingw_spawn_applet(mode, argv, envp);
321 else 321 else
322#endif 322#endif
323 if (strchr(cmd, '/') || strchr(cmd, '\\')) { 323 if (strchr(cmd, '/') || strchr(cmd, '\\') || has_dos_drive_prefix(cmd)) {
324 return mingw_spawn_interpreter(mode, cmd, argv, envp); 324 const char *path = auto_win32_extension(cmd);
325 return mingw_spawn_interpreter(mode, path ? path : cmd, argv, envp);
325 } 326 }
326 else if ((prog=find_first_executable(cmd)) != NULL) { 327 else if ((prog=find_first_executable(cmd)) != NULL) {
327 intptr_t ret = mingw_spawn_interpreter(mode, prog, argv, envp); 328 intptr_t ret = mingw_spawn_interpreter(mode, prog, argv, envp);