diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/posixmodule.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 885c267..0837a4a 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -1444,15 +1444,15 @@ win32_wchdir(LPCWSTR path) return FALSE; } } - if (wcsncmp(new_path, L"\\\\", 2) == 0 || - wcsncmp(new_path, L"//", 2) == 0) - /* UNC path, nothing to do. */ - return TRUE; - env[1] = new_path[0]; - result = SetEnvironmentVariableW(env, new_path); + int is_unc_like_path = (wcsncmp(new_path, L"\\\\", 2) == 0 || + wcsncmp(new_path, L"//", 2) == 0); + if (!is_unc_like_path) { + env[1] = new_path[0]; + result = SetEnvironmentVariableW(env, new_path); + } if (new_path != path_buf) PyMem_RawFree(new_path); - return result; + return result ? TRUE : FALSE; } #endif |