Skip to content

Commit

Permalink
SDL3's SDL_GetBasePath follows the SDL_GetStringRule
Browse files Browse the repository at this point in the history
  • Loading branch information
madebr committed Jul 17, 2024
1 parent 80d7f20 commit 96c7e12
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions test/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,14 @@ GetStringBoolean(const char *value, SDL_bool default_value)
static char *
GetTestFilename(TestFileType type, const char *file)
{
const char *env;
char *base = NULL;
const char *base;
char *path = NULL;
SDL_bool needPathSep = SDL_TRUE;

if (type == TEST_FILE_DIST) {
env = SDL_getenv("SDL_TEST_SRCDIR");
base = SDL_getenv("SDL_TEST_SRCDIR");
} else {
env = SDL_getenv("SDL_TEST_BUILDDIR");
}

if (env != NULL) {
base = SDL_strdup(env);
if (base == NULL) {
return NULL;
}
base = SDL_getenv("SDL_TEST_BUILDDIR");
}

if (base == NULL) {
Expand All @@ -102,8 +94,6 @@ GetTestFilename(TestFileType type, const char *file)
} else {
SDL_snprintf(path, len, "%s%s", base, file);
}

SDL_free(base);
} else {
path = SDL_strdup(file);
if (path == NULL) {
Expand Down

0 comments on commit 96c7e12

Please sign in to comment.