소스 검색

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

Petar Popovic 6 달 전
부모
커밋
961a04fa26
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;
             return NULL;
         }
         }
         char *ptr = &pathcpy[pathlen-1];
         char *ptr = &pathcpy[pathlen-1];
-        while ((ptr >= pathcpy) && ((*ptr == '/') || (*ptr == '\\'))) {
+        while ((ptr > pathcpy) && ((*ptr == '/') || (*ptr == '\\'))) {
             *(ptr--) = '\0';
             *(ptr--) = '\0';
         }
         }
         path = pathcpy;
         path = pathcpy;