qt: Fix HDD path relativization on Windows

This commit is contained in:
Cacodemon345
2022-03-04 01:17:38 +06:00
parent 83b87a7a8f
commit 7dc84e0f67
7 changed files with 40 additions and 3 deletions

View File

@@ -282,12 +282,22 @@ plat_path_abs(char *path)
return path[0] == '/';
}
void
plat_path_normalize(char* path)
{
while (*path++ != 0)
{
if (*path == '\\') *path = '/';
}
}
void
plat_path_slash(char *path)
{
if ((path[strlen(path)-1] != '/')) {
strcat(path, "/");
}
plat_path_normalize(path);
}
void