aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorPedro J. Estébanez2018-03-18 14:04:50 +0100
committerHein-Pieter van Braam2018-04-28 17:35:48 +0200
commitc07d588e8093aad5d984a9750bd5186563cc63f5 (patch)
tree0be2214403d66dcf8879f03d3dee5be76e3583c7 /core
parent52c710f25a1b8dcdb1cd967c755fba6a93db1fc6 (diff)
downloadgodot-c07d588e8093aad5d984a9750bd5186563cc63f5.tar.gz
godot-c07d588e8093aad5d984a9750bd5186563cc63f5.tar.zst
godot-c07d588e8093aad5d984a9750bd5186563cc63f5.zip
Fix listing files inside directory in pack file
When adding a directory path to the inventory of the pack, an empty file name was being added to the file list. That made `Directory.get_ntext()` signal end-of-list too early so that files in a subdirectory were missed. Fixes #15801. Helps with #16798. (cherry picked from commit 536611704a2be026682ce3d6c7454b97122d341e)
Diffstat (limited to 'core')
-rw-r--r--core/io/file_access_pack.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp
index 1a16d0f61..efb4c7a07 100644
--- a/core/io/file_access_pack.cpp
+++ b/core/io/file_access_pack.cpp
@@ -88,7 +88,11 @@ void PackedData::add_path(const String &pkg_path, const String &path, uint64_t o
}
}
}
- cd->files.insert(path.get_file());
+ String filename = path.get_file();
+ // Don't add as a file if the path points to a directoryy
+ if (!filename.empty()) {
+ cd->files.insert(filename);
+ }
}
}