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 {
|
} else {
|
||||||
dir_end = path;
|
dir_end = path;
|
||||||
|
|
||||||
/* The file is really only a name; look in cwd first, then scan path */
|
if (NeedCurrentDirectoryForExePathW(L"")) {
|
||||||
result = path_search_walk_ext(L"", 0,
|
/* The file is really only a name; look in cwd first, then scan path */
|
||||||
file, file_len,
|
result = path_search_walk_ext(L"", 0,
|
||||||
cwd, cwd_len,
|
file, file_len,
|
||||||
name_has_ext);
|
cwd, cwd_len,
|
||||||
|
name_has_ext);
|
||||||
|
}
|
||||||
|
|
||||||
while (result == NULL) {
|
while (result == NULL) {
|
||||||
if (dir_end == NULL || *dir_end == L'\0') {
|
if (dir_end == NULL || *dir_end == L'\0') {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user