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
2024-03-18 08:43:22 -07:00
parent ebb6582534
commit 92d01ef12a
4 changed files with 22 additions and 8 deletions

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) {