summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2023-12-01 14:16:29 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2023-12-01 14:31:13 (GMT)
commitab561b86fb4b1715ae6f65483d99833f97031fb3 (patch)
treee1d867f13d56370904b4ad5f87529216c661f6e9
parent8bd78627dd3d4d2b6f83a4b688ad97cc71840857 (diff)
downloadCMake-ab561b86fb4b1715ae6f65483d99833f97031fb3.zip
CMake-ab561b86fb4b1715ae6f65483d99833f97031fb3.tar.gz
CMake-ab561b86fb4b1715ae6f65483d99833f97031fb3.tar.bz2
libuv: win: honor NoDefaultCurrentDirectoryInExePath env var
Backport commit 5e302730cd (win: honor NoDefaultCurrentDirectoryInExePath env var, 2023-12-01) from libuv PR 4238.
-rw-r--r--Utilities/cmlibuv/src/win/process.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/Utilities/cmlibuv/src/win/process.c b/Utilities/cmlibuv/src/win/process.c
index 172b80b..02b6c26 100644
--- a/Utilities/cmlibuv/src/win/process.c
+++ b/Utilities/cmlibuv/src/win/process.c
@@ -391,10 +391,12 @@ static WCHAR* search_path(const WCHAR *file,
} else {
dir_end = path;
- /* The file is really only a name; look in cwd first, then scan path */
- result = path_search_walk_ext(L"", 0,
- file, file_len,
- cwd, cwd_len);
+ if (NeedCurrentDirectoryForExePathW(L"")) {
+ /* The file is really only a name; look in cwd first, then scan path */
+ result = path_search_walk_ext(L"", 0,
+ file, file_len,
+ cwd, cwd_len);
+ }
while (result == NULL) {
if (dir_end == NULL || *dir_end == L'\0') {