Remove extra path separator in GetNearbyFilename
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
diff --git a/test/testutils.c b/test/testutils.c
index e6773ac..ab58824 100644
--- a/test/testutils.c
+++ b/test/testutils.c
@@ -6,14 +6,6 @@ SPDX-License-Identifier: Zlib
#include "testutils.h"
-#if defined(SDL_FILESYSTEM_OS2) || defined(SDL_FILESYSTEM_WINDOWS)
-static const char pathsep[] = "\\";
-#elif defined(SDL_FILESYSTEM_RISCOS)
-static const char pathsep[] = ".";
-#else
-static const char pathsep[] = "/";
-#endif
-
/*
* Return the absolute path to def in the SDL_GetBasePath() if possible, or
* the relative path to def on platforms that don't have a working
@@ -31,7 +23,7 @@ GetNearbyFilename(const char *file)
if (base != NULL) {
SDL_RWops *rw;
- size_t len = SDL_strlen(base) + SDL_strlen(pathsep) + SDL_strlen(file) + 1;
+ size_t len = SDL_strlen(base) + SDL_strlen(file) + 1;
path = SDL_malloc(len);
@@ -41,7 +33,7 @@ GetNearbyFilename(const char *file)
return NULL;
}
- SDL_snprintf(path, len, "%s%s%s", base, pathsep, file);
+ SDL_snprintf(path, len, "%s%s", base, file);
SDL_free(base);
rw = SDL_RWFromFile(path, "rb");