소스 검색

* [ZIP] BugFix: Correct another codepath that may fail due to case sensitive string searches.

Robert MacGregor 3 년 전
부모
커밋
c376bc3f9c
1개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  1. 8 1
      Engine/source/core/util/zip/zipVolume.cpp

+ 8 - 1
Engine/source/core/util/zip/zipVolume.cpp

@@ -487,8 +487,15 @@ FileNodeRef ZipFileSystem::resolveLoose(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