Browse Source

Ignore directory entries in TPZ

Zip files may contain directory entries, they always end with a path
separator and zip entries always use forward slashes for path separators.

There's no need to create the directories included in the zip file,
since they'll already be created when creating the individual files.

(cherry picked from commit 59a5a1eb70dc02bec4a6462d36ef6a0daaa8694e)
Raul Santos 2 năm trước cách đây
mục cha
commit
f4e6063ed8
1 tập tin đã thay đổi với 7 bổ sung0 xóa
  1. 7 0
      editor/export/export_template_manager.cpp

+ 7 - 0
editor/export/export_template_manager.cpp

@@ -465,6 +465,13 @@ bool ExportTemplateManager::_install_file_selected(const String &p_file, bool p_
 			break;
 		}
 
+		if (String::utf8(fname).ends_with("/")) {
+			// File is a directory, ignore it.
+			// Directories will be created when extracting each file.
+			ret = unzGoToNextFile(pkg);
+			continue;
+		}
+
 		String file_path(String::utf8(fname).simplify_path());
 
 		String file = file_path.get_file();