summaryrefslogtreecommitdiffstats
path: root/editor
diff options
context:
space:
mode:
authorRaul Santos <raulsntos@gmail.com>2023-07-12 14:36:12 +0200
committerRaul Santos <raulsntos@gmail.com>2023-07-12 14:38:46 +0200
commit59a5a1eb70dc02bec4a6462d36ef6a0daaa8694e (patch)
tree80df13c787311197e0f137497d5330f996dd6e3e /editor
parent83cc5d4914a6bff76069ac19191192337e4df3de (diff)
downloadredot-engine-59a5a1eb70dc02bec4a6462d36ef6a0daaa8694e.tar.gz
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.
Diffstat (limited to 'editor')
-rw-r--r--editor/export/export_template_manager.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/editor/export/export_template_manager.cpp b/editor/export/export_template_manager.cpp
index e551b0531a..0fb6eaaac8 100644
--- a/editor/export/export_template_manager.cpp
+++ b/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();