mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-28 11:57:24 +08:00
iOS: if the file doesn't exist in the pref path, use the current directory
Fixes https://github.com/libsdl-org/SDL/issues/14743
This commit is contained in:
@@ -377,6 +377,10 @@ bool SDL_SYS_GetPathInfo(const char *path, SDL_PathInfo *info)
|
|||||||
}
|
}
|
||||||
rc = stat(apath, &statbuf);
|
rc = stat(apath, &statbuf);
|
||||||
SDL_free(apath);
|
SDL_free(apath);
|
||||||
|
|
||||||
|
if (rc < 0) {
|
||||||
|
rc = stat(path, &statbuf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
rc = stat(path, &statbuf);
|
rc = stat(path, &statbuf);
|
||||||
|
|||||||
@@ -985,6 +985,10 @@ SDL_IOStream *SDL_IOFromFile(const char *file, const char *mode)
|
|||||||
|
|
||||||
fp = fopen(path, mode);
|
fp = fopen(path, mode);
|
||||||
SDL_free(path);
|
SDL_free(path);
|
||||||
|
|
||||||
|
if (!fp) {
|
||||||
|
fp = fopen(file, mode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fp) {
|
if (!fp) {
|
||||||
|
|||||||
Reference in New Issue
Block a user