From cd5d5c52f6e05016d6d84bf1e980968abc1305c3 Mon Sep 17 00:00:00 2001 From: Catania Date: Fri, 16 Jan 2026 04:04:14 +0100 Subject: [PATCH] Fix count directories only if filter contains DIRECTORY_FILTER_TAG --- src/rcore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rcore.c b/src/rcore.c index c6535bc9d..c119d5215 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -4308,7 +4308,7 @@ static unsigned int GetDirectoryFileCountEx(const char *basePath, const char *fi } else { - if (filter == NULL || strstr(filter, DIRECTORY_FILTER_TAG) != NULL) fileCounter++; + if ((filter != NULL) && (strstr(filter, DIRECTORY_FILTER_TAG) != NULL)) fileCounter++; if (scanSubdirs) fileCounter += GetDirectoryFileCountEx(path, filter, scanSubdirs); } }