win: honor NoDefaultCurrentDirectoryInExePath env var (#4238)
Fixes: https://github.com/libuv/libuv/issues/3888 Refs: https://github.com/nodejs/node/issues/46264
This commit is contained in:
parent
a5c01d4de3
commit
5e302730cd
@ -377,11 +377,13 @@ 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,
|
||||
name_has_ext);
|
||||
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,
|
||||
name_has_ext);
|
||||
}
|
||||
|
||||
while (result == NULL) {
|
||||
if (dir_end == NULL || *dir_end == L'\0') {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user