* [ZIPVolume] BugFix: Add the capability of resolving ZIP prefix paths with case insensitivity and a CMake option to control this behavior.

This commit is contained in:
Robert MacGregor 2021-10-11 19:02:58 -04:00
parent f3eadb922b
commit 8d0128698a
3 changed files with 14 additions and 1 deletions

View file

@ -407,8 +407,15 @@ FileNodeRef ZipFileSystem::resolve(const Path& path)
if(mZipNameIsDir)
{
// Remove the fake root from the name so things can be found
#ifdef TORQUE_ZIP_PATH_CASE_INSENSITIVE
String lowerFakeRoot = String::ToLower(mFakeRoot);
String lowerName = String::ToLower(name);
if(lowerName.find(lowerFakeRoot) == 0)
name = name.substr(mFakeRoot.length());
#else
if(name.find(mFakeRoot) == 0)
name = name.substr(mFakeRoot.length());
name = name.substr(mFakeRoot.length());
#endif
#ifdef TORQUE_DISABLE_FIND_ROOT_WITHIN_ZIP
else

View file

@ -166,6 +166,9 @@ mark_as_advanced(TORQUE_MULTITHREAD)
option(TORQUE_POSIX_PATH_CASE_INSENSITIVE ON)
mark_as_advanced(TORQUE_POSIX_PATH_CASE_INSENSITIVE)
option(TORQUE_ZIP_PATH_CASE_INSENSITIVE ON)
mark_as_advanced(TORQUE_ZIP_PATH_CASE_INSENSITIVE)
option(TORQUE_DISABLE_MEMORY_MANAGER "Disable memory manager" ON)
mark_as_advanced(TORQUE_DISABLE_MEMORY_MANAGER)

View file

@ -47,6 +47,9 @@
/// Define me if you want path case insensitivity support on POSIX systems. Does nothing on Windows.
#cmakedefine TORQUE_POSIX_PATH_CASE_INSENSITIVE
/// Define me if you want path case insensitivity support in ZIP files.
#cmakedefine TORQUE_ZIP_PATH_CASE_INSENSITIVE
/// Define me if you want to enable multithreading support.
#cmakedefine TORQUE_MULTITHREAD