SDL: SDL_GlobDirectory(): Don't chop off first slash from path, if it's just multiple slashes (fb312)

From fb312b2463bd045d4d4cefcd0179b1c4c7ce6b0b Mon Sep 17 00:00:00 2001
From: Petar Popovic <[EMAIL REDACTED]>
Date: Sat, 7 Mar 2026 11:26:11 +0100
Subject: [PATCH] SDL_GlobDirectory(): Don't chop off first slash from path, if
 it's just multiple slashes

(cherry picked from commit 961a04fa26727db7b588d529f71f9e7587697f2c)
---
 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 43d31e004d58b..6a3bb25afcb41 100644
--- a/src/filesystem/SDL_filesystem.c
+++ b/src/filesystem/SDL_filesystem.c
@@ -380,7 +380,7 @@ char **SDL_InternalGlobDirectory(const char *path, const char *pattern, SDL_Glob
             return NULL;
         }
         char *ptr = &pathcpy[pathlen-1];
-        while ((ptr >= pathcpy) && ((*ptr == '/') || (*ptr == '\\'))) {
+        while ((ptr > pathcpy) && ((*ptr == '/') || (*ptr == '\\'))) {
             *(ptr--) = '\0';
         }
         path = pathcpy;