Переглянути джерело

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

(cherry picked from commit 961a04fa26727db7b588d529f71f9e7587697f2c)
Petar Popovic 7 місяців тому
батько
коміт
fb312b2463
1 змінених файлів з 1 додано та 1 видалено
  1. 1 1
      src/filesystem/SDL_filesystem.c

+ 1 - 1
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;