From: havoc Date: Mon, 2 Feb 2009 00:52:34 +0000 (+0000) Subject: At O.Sezer's recommendation filematch.c has been changed to use X-Git-Tag: xonotic-v0.1.0preview~1902 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=31c60f86f584447beac6b654e54587229f2c9496;p=xonotic%2Fdarkplaces.git At O.Sezer's recommendation filematch.c has been changed to use FindFirstFile and friends instead of _findfirst and friends. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8692 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/filematch.c b/filematch.c index 0755f14a..c88c704e 100644 --- a/filematch.c +++ b/filematch.c @@ -138,24 +138,24 @@ static void adddirentry(stringlist_t *list, const char *path, const char *name) } } #ifdef WIN32 -#include +#include void listdirectory(stringlist_t *list, const char *basepath, const char *path) { int i; char pattern[4096], *c; - struct _finddata_t n_file; - long hFile; + WIN32_FIND_DATA n_file; + HANDLE hFile; strlcpy (pattern, basepath, sizeof(pattern)); strlcat (pattern, path, sizeof (pattern)); strlcat (pattern, "*", sizeof (pattern)); // ask for the directory listing handle - hFile = _findfirst(pattern, &n_file); - if(hFile == -1) + hFile = FindFirstFile(pattern, &n_file); + if(hFile == INVALID_HANDLE_VALUE) return; do { - adddirentry(list, path, n_file.name ); - } while (_findnext(hFile, &n_file) == 0); - _findclose(hFile); + adddirentry(list, path, n_file.cFileName); + } while (FindNextFile(hFile, &n_file) != 0); + FindClose(hFile); // convert names to lowercase because windows does not care, but pattern matching code often does for (i = 0;i < list->numstrings;i++)