Skip to content

Commit

Permalink
filesystem: SDL_GlobDirectory shouldn't strip final '/' if the path i…
Browse files Browse the repository at this point in the history
…s "/".

This is common on Emscripten, where the base directory is "/".
  • Loading branch information
icculus committed Sep 30, 2024
1 parent 7241dd9 commit 6a7f8b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/filesystem/SDL_filesystem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
char *pathcpy = NULL;
size_t pathlen = SDL_strlen(path);
if (pathlen && (path[pathlen-1] == '/')) {
if ((pathlen > 1) && (path[pathlen-1] == '/')) {
pathcpy = SDL_strdup(path);
if (!pathcpy) {
return NULL;
Expand Down

0 comments on commit 6a7f8b7

Please sign in to comment.