mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 14:43:20 +00:00
filesystem: GetCurrentDirectory now falls back to GetBasePath when unsupported
This commit is contained in:
parent
b1b98b10d8
commit
4ee79e6493
2 changed files with 12 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue