Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL3's SDL_GetBasePath follows the SDL_GetStringRule #458

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading