From e6ea82344a676b3280b46313d010495688b9b0fa Mon Sep 17 00:00:00 2001 From: Raul Santos Date: Wed, 12 Jul 2023 14:36:12 +0200 Subject: [PATCH] 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) --- editor/export/export_template_manager.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/editor/export/export_template_manager.cpp b/editor/export/export_template_manager.cpp index 26ed7c46fbd..89c168174ff 100644 --- a/editor/export/export_template_manager.cpp +++ b/editor/export/export_template_manager.cpp @@ -466,6 +466,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();