From e5763e2e9a542c694ba1a52a564782d32277c97a Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 3 Jan 2023 01:15:24 +0300 Subject: [PATCH] filesystem: dir: check dir casesensitivity after dir entries list was properly initialized --- filesystem/dir.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/filesystem/dir.c b/filesystem/dir.c index 05b016e6..f6e435dd 100644 --- a/filesystem/dir.c +++ b/filesystem/dir.c @@ -295,6 +295,13 @@ qboolean FS_FixFileCase( dir_t *dir, const char *path, char *dst, const size_t l char entryname[MAX_SYSPATH]; int ret; + if( dir->numentries == DIRENTRY_NOT_SCANNED ) + { + // read directory first time + FS_PopulateDirEntries( dir, dst ); + uptodate = true; + } + // this subdirectory is case insensitive, just slam everything that's left if( dir->numentries == DIRENTRY_CASEINSENSITIVE ) { @@ -303,13 +310,6 @@ qboolean FS_FixFileCase( dir_t *dir, const char *path, char *dst, const size_t l break; } - if( dir->numentries == DIRENTRY_NOT_SCANNED ) - { - // read directory first time - FS_PopulateDirEntries( dir, dst ); - uptodate = true; - } - // get our entry name Q_strncpy( entryname, prev, next - prev + 1 );