Skip to content
Snippets Groups Projects
Commit 8624486f authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Fix cache subdirectories on Windows.

Windows appears to treat backslashes and slashes the same when
using the API, but Windows always returns backslashes.  Convert
backslashes to slashes in clean_path() to ensure paths compare the
same regardless of them being specified with backslashes or slashes.

There's still an open question of what to do about paths received
from the remote with backslashes in them, but I suspect that doing
that would actually work on *nix systems and break on Windows systems,
so hopefully whoever does that can fogure out what's going on.
parent a9189017
Branches
Tags
No related merge requests found
Pipeline #6847 passed
......@@ -3,6 +3,7 @@ Version 1.2rc3
Get Haiku support building again
Properly quit video subsystem from video thread - fixes Haiku crash
Create dirs on macOS when needed - fixes adding first BBS
Fix cache subdirectories on Windows
Version 1.2rc2
--------------
......
......@@ -2426,7 +2426,21 @@ clean_path(char *fn, size_t fnsz)
{
char *fp;
#ifdef _WIN32
// Convert all backslashes to slashes...
for (char *fpc = fn; *fpc; fpc++) {
if (*fpc == '\\')
*fpc = '/';
}
#endif
fp = _fullpath(NULL, fn, fnsz);
#ifdef _WIN32
// Convert all backslashes to slashes...
for (char *fpc = fp; *fpc; fpc++) {
if (*fpc == '\\')
*fpc = '/';
}
#endif
if ((fp == NULL) || strcmp(fp, fn)) {
FREE_AND_NULL(fp);
return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment