win,spawn: allow UNC path with forward slash

Fixes: https://github.com/libuv/libuv/issues/3159
PR-URL: https://github.com/libuv/libuv/pull/3167
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
This commit is contained in:
earnal 2021-09-08 17:27:08 +02:00 committed by GitHub
parent 66a3053e70
commit 7024f8b242
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -169,7 +169,9 @@ static WCHAR* search_path_join_test(const WCHAR* dir,
size_t cwd_len) {
WCHAR *result, *result_pos;
DWORD attrs;
if (dir_len > 2 && dir[0] == L'\\' && dir[1] == L'\\') {
if (dir_len > 2 &&
((dir[0] == L'\\' || dir[0] == L'/') &&
(dir[1] == L'\\' || dir[1] == L'/'))) {
/* It's a UNC path so ignore cwd */
cwd_len = 0;
} else if (dir_len >= 1 && (dir[0] == L'/' || dir[0] == L'\\')) {