You can pass NULL to SDL_GetPathInfo() and SDL_GetStoragePathInfo() to test for the existence of a file.

This commit is contained in:
Sam Lantinga committed 2024-03-18 08:56:24 -07:00
1 parent ebb6582534
commit 92d01ef12a
4 files changed
+22 -8

No files matched your search

+7
View File
@@ -290,6 +290,13 @@ int SDL_RenameStoragePath(SDL_Storage *storage, const char *oldpath, const char
int SDL_GetStoragePathInfo(SDL_Storage *storage, const char *path, SDL_PathInfo *info)
{
SDL_PathInfo dummy;
if (!info) {
info = &dummy;
}
SDL_zerop(info);
CHECK_STORAGE_MAGIC()
if (!path) {