mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-10 02:55:36 +00:00
SDL_GlobDirectory(): Don't chop off first slash from path, if it's just multiple slashes
(cherry picked from commit 961a04fa26)
This commit is contained in:
committed by
Sam Lantinga
parent
b08f7924a4
commit
fb312b2463
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user