mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-16 22:37:30 +08:00
libuv: win,spawn: allow %PATH% to be unset
Backport libuv commit `c97017dd` (win,spawn: allow `%PATH%` to be unset, 2023-08-14). See https://github.com/libuv/libuv/pull/4116.
This commit is contained in:
@@ -394,7 +394,7 @@ static WCHAR* search_path(const WCHAR *file,
|
|||||||
name_has_ext);
|
name_has_ext);
|
||||||
|
|
||||||
while (result == NULL) {
|
while (result == NULL) {
|
||||||
if (*dir_end == L'\0') {
|
if (dir_end == NULL || *dir_end == L'\0') {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1027,11 +1027,7 @@ int uv_spawn(uv_loop_t* loop,
|
|||||||
DWORD path_len, r;
|
DWORD path_len, r;
|
||||||
|
|
||||||
path_len = GetEnvironmentVariableW(L"PATH", NULL, 0);
|
path_len = GetEnvironmentVariableW(L"PATH", NULL, 0);
|
||||||
if (path_len == 0) {
|
if (path_len != 0) {
|
||||||
err = GetLastError();
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
|
|
||||||
alloc_path = (WCHAR*) uv__malloc(path_len * sizeof(WCHAR));
|
alloc_path = (WCHAR*) uv__malloc(path_len * sizeof(WCHAR));
|
||||||
if (alloc_path == NULL) {
|
if (alloc_path == NULL) {
|
||||||
err = ERROR_OUTOFMEMORY;
|
err = ERROR_OUTOFMEMORY;
|
||||||
@@ -1045,6 +1041,7 @@ int uv_spawn(uv_loop_t* loop,
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
err = uv__stdio_create(loop, options, &process->child_stdio_buffer);
|
err = uv__stdio_create(loop, options, &process->child_stdio_buffer);
|
||||||
if (err)
|
if (err)
|
||||||
|
Reference in New Issue
Block a user