From 8af454a0a107cc4034340c3ca0fc2bae95764c10 Mon Sep 17 00:00:00 2001 From: Petar Popovic Date: Fri, 27 Mar 2026 22:57:48 +0100 Subject: [PATCH] SDL_GlobDirectory(): Don't descend into sub-directories, if not requested by pattern (cherry picked from commit d6129d063f512583c9446a8443ca34ebebb39c49) --- src/filesystem/SDL_filesystem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/filesystem/SDL_filesystem.c b/src/filesystem/SDL_filesystem.c index 6a52baf28b..dca0da5c99 100644 --- a/src/filesystem/SDL_filesystem.c +++ b/src/filesystem/SDL_filesystem.c @@ -203,7 +203,7 @@ static bool WildcardMatch(const char *pattern, const char *str, bool *matched_to pch = *(++pattern); } - *matched_to_dir = ((pch == '/') || (pch == '\0')); // end of string and the pattern is complete or failed at a '/'? We should descend into this directory. + *matched_to_dir = (pch == '/'); // end of string and the pattern failed at a '/'? We should descend into this directory. return (pch == '\0'); // survived the whole pattern? That's a match! }