Skip to content

Commit

Permalink
win: honor NoDefaultCurrentDirectoryInExePath env var (libuv#4238)
Browse files Browse the repository at this point in the history
  • Loading branch information
ardinugrxha authored Nov 30, 2023
1 parent a5c01d4 commit 5e30273
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/win/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down

0 comments on commit 5e30273

Please sign in to comment.