mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 06:34:35 +00:00
storage: deal with paths with Windows '\\' path separators appended.
Reference Issue #11986.
This commit is contained in:
parent
7c6adc1ca7
commit
a6a8598b98
1 changed files with 6 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue