diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2010-07-05 20:46:32 +0200 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2010-07-05 20:46:32 +0200 |
| commit | d302ba921e61177da9af1f85df58fe6f47ca5e95 (patch) | |
| tree | 4ac19b9caab0a7142b6dfbc05d234af152bd5407 /src/base/system.c | |
| parent | 143af11a25bc4a944c3605b9a165ffd2f1970641 (diff) | |
| parent | bd02c2043e9f76ec47ee9ac35caf23ae294b1dfa (diff) | |
| download | zcatch-d302ba921e61177da9af1f85df58fe6f47ca5e95.tar.gz zcatch-d302ba921e61177da9af1f85df58fe6f47ca5e95.zip | |
Merge branch 'master' of github.com:matricks/teeworlds
Diffstat (limited to 'src/base/system.c')
| -rw-r--r-- | src/base/system.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/base/system.c b/src/base/system.c index a1a1b33e..457b761a 100644 --- a/src/base/system.c +++ b/src/base/system.c @@ -262,7 +262,23 @@ int mem_check_imp() IOHANDLE io_open(const char *filename, int flags) { if(flags == IOFLAG_READ) + { + #if defined(CONF_FAMILY_WINDOWS) + // check for filename case sensitive + WIN32_FIND_DATA finddata; + HANDLE handle; + int length; + + length = str_length(filename); + if(!filename || !length || filename[length-1] == '\\') + return 0x0; + handle = FindFirstFile(filename, &finddata); + if(handle == INVALID_HANDLE_VALUE || str_comp(filename+length-str_length(finddata.cFileName), finddata.cFileName)) + return 0x0; + FindClose(handle); + #endif return (IOHANDLE)fopen(filename, "rb"); + } if(flags == IOFLAG_WRITE) return (IOHANDLE)fopen(filename, "wb"); return 0x0; @@ -863,7 +879,8 @@ int fs_listdir(const char *dir, FS_LISTDIR_CALLBACK cb, void *user) /* add all the entries */ do { - cb(finddata.cFileName, 0, user); + if(finddata.cFileName[0] != '.') + cb(finddata.cFileName, 0, user); } while (FindNextFileA(handle, &finddata)); FindClose(handle); |