mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-28 14:08: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);
|
len += SDL_strlen(path);
|
||||||
}
|
}
|
||||||
if (len > 0) {
|
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);
|
basepath = SDL_strdup(path);
|
||||||
if (!basepath) {
|
if (!basepath) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Reference in New Issue
Block a user