diff --git a/docs/rh-log.txt b/docs/rh-log.txt index aeb746ebc..f59a5f104 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,6 @@ +April 21, 2006 (Changes by Graf Zahl) +- Added Zloba's fix for Linux's I_FindFirst. + April 20, 2006 (Changes by Graf Zahl) - Fixed: Doom's status bar assumed that STBAR was always in Doom patch format. - Added MF3_DONTSPLASH to the newly created sound sequence things. diff --git a/src/sdl/i_system.cpp b/src/sdl/i_system.cpp index 7a0c61f97..258a858a0 100644 --- a/src/sdl/i_system.cpp +++ b/src/sdl/i_system.cpp @@ -61,6 +61,7 @@ #include "stats.h" #include "hardware.h" +#include "zstring.h" EXTERN_CVAR (String, language) @@ -385,14 +386,22 @@ static int matchfile (const struct dirent *ent) void *I_FindFirst (const char *filespec, findstate_t *fileinfo) { + string dir; + char *slash = strrchr (filespec, '/'); if (slash) + { pattern = slash+1; + dir = string(filespec, slash-filespec+1); + } else + { pattern = filespec; + dir = "."; + } fileinfo->current = 0; - fileinfo->count = scandir (".", &fileinfo->namelist, + fileinfo->count = scandir (dir.GetChars(), &fileinfo->namelist, matchfile, alphasort); if (fileinfo->count > 0) {