Commit 08538bc5 authored by Victor Stinner's avatar Victor Stinner

copy_absolute(): keep the relative path if _wgetcwd() failed

Instead of using the undefined content of the 'path' buffer.
parent 918616ce
......@@ -300,7 +300,11 @@ copy_absolute(wchar_t *path, wchar_t *p)
if (p[0] == SEP)
wcscpy(path, p);
else {
_wgetcwd(path, MAXPATHLEN);
if (!_wgetcwd(path, MAXPATHLEN)) {
/* unable to get the current directory */
wcscpy(path, p);
return;
}
if (p[0] == '.' && p[1] == SEP)
p += 2;
joinpath(path, p);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment