summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2023-12-04 19:50:05 (GMT)
committerBrad King <brad.king@kitware.com>2023-12-04 19:50:06 (GMT)
commitfc6231bee53a8991a2da0529c541a1373ff1b721 (patch)
tree89cab0cd2968234bf0154d0392af5e24f0323ea3 /Utilities
parentb37d9378de961c98785df6a7d2bd3de21f7478b8 (diff)
downloadCMake-fc6231bee53a8991a2da0529c541a1373ff1b721.zip
CMake-fc6231bee53a8991a2da0529c541a1373ff1b721.tar.gz
CMake-fc6231bee53a8991a2da0529c541a1373ff1b721.tar.bz2
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
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/cmlibuv/src/win/process.c8
1 files 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;