mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-30 15:08:31 +00:00
You can pass NULL to SDL_GetPathInfo() and SDL_GetStoragePathInfo() to test for the existence of a file.
This commit is contained in:
@@ -93,10 +93,16 @@ int SDL_EnumerateDirectory(const char *path, SDL_EnumerateDirectoryCallback call
|
||||
|
||||
int SDL_GetPathInfo(const char *path, SDL_PathInfo *info)
|
||||
{
|
||||
SDL_PathInfo dummy;
|
||||
|
||||
if (!info) {
|
||||
info = &dummy;
|
||||
}
|
||||
SDL_zerop(info);
|
||||
|
||||
if (!path) {
|
||||
return SDL_InvalidParamError("path");
|
||||
} else if (!info) {
|
||||
return SDL_InvalidParamError("info");
|
||||
}
|
||||
|
||||
return SDL_SYS_GetPathInfo(path, info);
|
||||
}
|
||||
|
Reference in New Issue
Block a user