mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-30 15:08:31 +00:00
filesystem: SDL_GlobDirectory shouldn't strip final '/' if the path is "/".
This is common on Emscripten, where the base directory is "/".
This commit is contained in:
@@ -363,7 +363,7 @@ char **SDL_InternalGlobDirectory(const char *path, const char *pattern, SDL_Glob
|
|||||||
// if path ends with any '/', chop them off, so we don't confuse the pattern matcher later.
|
// if path ends with any '/', chop them off, so we don't confuse the pattern matcher later.
|
||||||
char *pathcpy = NULL;
|
char *pathcpy = NULL;
|
||||||
size_t pathlen = SDL_strlen(path);
|
size_t pathlen = SDL_strlen(path);
|
||||||
if (pathlen && (path[pathlen-1] == '/')) {
|
if ((pathlen > 1) && (path[pathlen-1] == '/')) {
|
||||||
pathcpy = SDL_strdup(path);
|
pathcpy = SDL_strdup(path);
|
||||||
if (!pathcpy) {
|
if (!pathcpy) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Reference in New Issue
Block a user