From beff2721928fdb624c227cccd15bde7ae68862e3 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sun, 29 Mar 2020 12:39:30 +0100 Subject: 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. --- win32/process.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'win32') 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) return mingw_spawn_applet(mode, argv, envp); else #endif - if (strchr(cmd, '/') || strchr(cmd, '\\')) { - return mingw_spawn_interpreter(mode, cmd, argv, envp); + if (strchr(cmd, '/') || strchr(cmd, '\\') || has_dos_drive_prefix(cmd)) { + const char *path = auto_win32_extension(cmd); + return mingw_spawn_interpreter(mode, path ? path : cmd, argv, envp); } else if ((prog=find_first_executable(cmd)) != NULL) { intptr_t ret = mingw_spawn_interpreter(mode, prog, argv, envp); -- cgit v1.2.3-55-g6feb