diff --git a/src/win/process.c b/src/win/process.c index 43059858..117054d4 100644 --- a/src/win/process.c +++ b/src/win/process.c @@ -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') {