filesystem: Added SDL_GetCurrentDirectory().

Fixes #11531.
This commit is contained in:
Ryan C. Gordon 2024-11-27 19:41:37 -05:00
parent 16113374ff
commit f852038384
10 changed files with 101 additions and 2 deletions

View file

@ -62,6 +62,7 @@ int main(int argc, char *argv[])
{
SDLTest_CommonState *state;
char *pref_path;
char *curdir;
const char *base_path;
/* Initialize test framework */
@ -106,6 +107,15 @@ int main(int argc, char *argv[])
}
SDL_free(pref_path);
curdir = SDL_GetCurrentDirectory();
if (!curdir) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't find current directory: %s\n",
SDL_GetError());
} else {
SDL_Log("current directory: '%s'\n", curdir);
}
SDL_free(curdir);
if (base_path) {
char **globlist;
SDL_IOStream *stream;