更新VFS类以支持大小写不敏感的文件查找,修复文件未找到时的错误处理

This commit is contained in:
2025-03-03 20:34:05 +08:00
parent e6a24c54a6
commit 446f41deac
3 changed files with 35 additions and 7 deletions

View File

@@ -75,6 +75,12 @@ HANDLE VFS::CreateFileW(std::wstring path) {
}
str = fileop::relpath(str, base_path);
str = str_util::str_replace(str, "\\", "/");
auto c = files.find(str);
if (c == files.end()) {
SetLastError(ERROR_FILE_NOT_FOUND);
return INVALID_HANDLE_VALUE;
}
str = (*c).first;
zip_t* archive = nullptr;
zip_uint64_t index = 0;
for (auto a : archives) {