summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/common/file_util.cpp2
-rw-r--r--src/core/file_sys/disk_archive.cpp6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp
index 052c0ecd6..c3061479a 100644
--- a/src/common/file_util.cpp
+++ b/src/common/file_util.cpp
@@ -457,7 +457,7 @@ bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string &directo
457 if (virtual_name == "." || virtual_name == "..") 457 if (virtual_name == "." || virtual_name == "..")
458 continue; 458 continue;
459 459
460 unsigned ret_entries; 460 unsigned ret_entries = 0;
461 if (!callback(&ret_entries, directory, virtual_name)) { 461 if (!callback(&ret_entries, directory, virtual_name)) {
462 callback_error = true; 462 callback_error = true;
463 break; 463 break;
diff --git a/src/core/file_sys/disk_archive.cpp b/src/core/file_sys/disk_archive.cpp
index 0ba502200..a51416774 100644
--- a/src/core/file_sys/disk_archive.cpp
+++ b/src/core/file_sys/disk_archive.cpp
@@ -139,7 +139,7 @@ bool DiskFile::Close() const {
139 139
140//////////////////////////////////////////////////////////////////////////////////////////////////// 140////////////////////////////////////////////////////////////////////////////////////////////////////
141 141
142DiskDirectory::DiskDirectory(const DiskArchive& archive, const Path& path) { 142DiskDirectory::DiskDirectory(const DiskArchive& archive, const Path& path) : directory() {
143 // TODO(Link Mauve): normalize path into an absolute path without "..", it can currently bypass 143 // TODO(Link Mauve): normalize path into an absolute path without "..", it can currently bypass
144 // the root directory we set while opening the archive. 144 // the root directory we set while opening the archive.
145 // For example, opening /../../usr/bin can give the emulated program your installed programs. 145 // For example, opening /../../usr/bin can give the emulated program your installed programs.
@@ -149,7 +149,9 @@ DiskDirectory::DiskDirectory(const DiskArchive& archive, const Path& path) {
149bool DiskDirectory::Open() { 149bool DiskDirectory::Open() {
150 if (!FileUtil::IsDirectory(path)) 150 if (!FileUtil::IsDirectory(path))
151 return false; 151 return false;
152 FileUtil::ScanDirectoryTree(path, directory); 152 unsigned size = FileUtil::ScanDirectoryTree(path, directory);
153 directory.size = size;
154 directory.isDirectory = true;
153 children_iterator = directory.children.begin(); 155 children_iterator = directory.children.begin();
154 return true; 156 return true;
155} 157}