fix conversion of absolute path names

This commit is contained in:
Alexander Arkhipov 2022-12-31 19:10:55 +03:00
parent ee51c38a50
commit 25e18b38b2
1 changed files with 2 additions and 2 deletions

View File

@ -295,11 +295,11 @@ void compat_windows_path_to_native(char* path)
end = strchr(pch, '\0'); end = strchr(pch, '\0');
temp = *end; temp = *end;
*end = '\0'; *end = '\0';
if (pch == path && *pch != '/') if (pch == path)
d = opendir("."); d = opendir(".");
else if (pch-1 == path && *(pch-1) == '/') else if (pch-1 == path && *(pch-1) == '/')
d = opendir("/"); d = opendir("/");
else { else if (pch > path) {
char temp2 = *(pch-1); char temp2 = *(pch-1);
*(pch-1) = '\0'; *(pch-1) = '\0';
d = opendir(path); d = opendir(path);