From 9aae758ec51608ab1ff8d91db162a67f72f82df0 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 22 Apr 2006 15:02:08 +0000 Subject: [PATCH] - Added Zloba's fix for Linux's I_FindFirst. SVN r63 (trunk) --- docs/rh-log.txt | 3 +++ src/sdl/i_system.cpp | 11 ++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) 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) {