mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-28 22:18:28 +00:00
storage: deal with paths with Windows '\\' path separators appended.
Reference Issue #11986.
This commit is contained in:
@@ -327,7 +327,12 @@ SDL_Storage *GENERIC_OpenFileStorage(const char *path)
|
||||
len += SDL_strlen(path);
|
||||
}
|
||||
if (len > 0) {
|
||||
if (path[len-1] == '/') {
|
||||
#ifdef SDL_PLATFORM_WINDOWS
|
||||
const bool appended_separator = (path[len-1] == '/') || (path[len-1] == '\\');
|
||||
#else
|
||||
const bool appended_separator = (path[len-1] == '/');
|
||||
#endif
|
||||
if (appended_separator) {
|
||||
basepath = SDL_strdup(path);
|
||||
if (!basepath) {
|
||||
return NULL;
|
||||
|
Reference in New Issue
Block a user