filesystem: GetCurrentDirectory now falls back to GetBasePath when unsupported

This commit is contained in:
Ethan Lee committed 2025-09-18 14:49:03 -04:00
1 parent b1b98b10d8
commit 4ee79e6493
2 files changed
+12 -5

No files matched your search

+6 -2
View File
@@ -47,8 +47,12 @@ char *SDL_SYS_GetUserFolder(SDL_Folder folder)
char *SDL_SYS_GetCurrentDirectory(void)
{
SDL_Unsupported();
return NULL;
const char *base = SDL_GetBasePath();
if (!base) {
return NULL;
}
return SDL_strdup(base);
}
#endif // SDL_FILESYSTEM_DUMMY || SDL_FILESYSTEM_DISABLED
+6 -3
View File
@@ -137,9 +137,12 @@ char *SDL_SYS_GetUserFolder(SDL_Folder folder)
return NULL;
}
// TODO
char *SDL_SYS_GetCurrentDirectory(void)
{
SDL_Unsupported();
return NULL;
const char *base = SDL_GetBasePath();
if (!base) {
return NULL;
}
return SDL_strdup(base);
}