From fc6231bee53a8991a2da0529c541a1373ff1b721 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Mon, 4 Dec 2023 14:50:05 -0500 Subject: libuv: win/spawn: run executables with no file extension Backport this commit from libuv PR 4241 to restore `execute_process()` support for running executables on Windows with no file extension. Fixes: #25450 --- Utilities/cmlibuv/src/win/process.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Utilities/cmlibuv/src/win/process.c b/Utilities/cmlibuv/src/win/process.c index 9d0ceba..7df3540 100644 --- a/Utilities/cmlibuv/src/win/process.c +++ b/Utilities/cmlibuv/src/win/process.c @@ -329,6 +329,8 @@ static WCHAR* path_search_walk_ext(const WCHAR *dir, * - If there's really only a filename, check the current directory for file, * then search all path directories. * + * - If a full path is specified, search for the exact filename first. + * * - If filename specified has *any* extension, search for the file with the * specified extension first. * @@ -392,12 +394,14 @@ static WCHAR* search_path(const WCHAR *file, name_has_ext = (dot != NULL && dot[1] != L'\0'); if (file_has_dir) { - /* The file has a path inside, don't use path */ + /* The file has a path inside, don't use path + * Try the exact filename first, and then try standard extensions + */ result = path_search_walk_ext( file, file_name_start - file, file_name_start, file_len - (file_name_start - file), cwd, cwd_len, - name_has_ext); + 1); } else { dir_end = path; -- cgit v0.12