From c17a368486a2692b6f52573ef46670622e2fa64b Mon Sep 17 00:00:00 2001 From: Spoike Date: Sat, 11 Nov 2017 20:17:52 +0000 Subject: [PATCH] query the filesystem cache to access the same filename case on disk as in the cache (instead of matching insensitively then using lower case for the actual access, which was resulting in issues on eg linux). this should fix the case issues on freecs's wads. note that the basedir and gamedirs are still not case insensitive, and it requires fs_cache enabled (which may still get temp-disabled following file writes, which I still need to fix, so downloads might still break things but fs_restart;vid_reload should fix them in that case). git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5164 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/fs.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/engine/common/fs.c b/engine/common/fs.c index d4412885..439dce44 100644 --- a/engine/common/fs.c +++ b/engine/common/fs.c @@ -1208,8 +1208,13 @@ int FS_FLocateFile(const char *filename, unsigned int lflags, flocation_t *loc) if (com_fs_cache.ival && !com_fschanged && !(lflags & FSLF_IGNOREPURE)) { - pf = Hash_GetInsensitive(&filesystemhash, filename); - if (!pf) + bucket_t *b = Hash_GetInsensitiveBucket(&filesystemhash, filename); + if (b) + { + pf = b->data; + filename = b->key.string; //update the filename to use the correct file case... + } + else goto fail; } else