diff --git a/src/filesystem/posix/SDL_sysfsops.c b/src/filesystem/posix/SDL_sysfsops.c index a18692749c..5e126b64a0 100644 --- a/src/filesystem/posix/SDL_sysfsops.c +++ b/src/filesystem/posix/SDL_sysfsops.c @@ -377,6 +377,10 @@ bool SDL_SYS_GetPathInfo(const char *path, SDL_PathInfo *info) } rc = stat(apath, &statbuf); SDL_free(apath); + + if (rc < 0) { + rc = stat(path, &statbuf); + } } #else rc = stat(path, &statbuf); diff --git a/src/io/SDL_iostream.c b/src/io/SDL_iostream.c index e8533df7fb..9639a66148 100644 --- a/src/io/SDL_iostream.c +++ b/src/io/SDL_iostream.c @@ -985,6 +985,10 @@ SDL_IOStream *SDL_IOFromFile(const char *file, const char *mode) fp = fopen(path, mode); SDL_free(path); + + if (!fp) { + fp = fopen(file, mode); + } } if (!fp) {