1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-12 13:20:55 +00:00

Fix decoding UTF-8 filenames on unzipping.

(cherry picked from commit d2573c1636)
This commit is contained in:
bruvzg
2022-01-05 14:27:11 +02:00
committed by Rémi Verschelde
parent 8d3e16676d
commit d2558bdc8c
8 changed files with 16 additions and 16 deletions

View File

@@ -204,7 +204,7 @@ private:
char fname[16384];
ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0);
if (String(fname).ends_with("project.godot")) {
if (String::utf8(fname).ends_with("project.godot")) {
break;
}
@@ -514,7 +514,7 @@ private:
char fname[16384];
unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0);
String name = fname;
String name = String::utf8(fname);
if (name.ends_with("project.godot")) {
zip_root = name.substr(0, name.rfind("project.godot"));
break;
@@ -534,7 +534,7 @@ private:
char fname[16384];
ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0);
String path = fname;
String path = String::utf8(fname);
if (path == String() || path == zip_root || !zip_root.is_subsequence_of(path)) {
//