summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Subv2015-12-25 17:03:59 -0500
committerGravatar Subv2016-01-16 09:30:29 -0500
commit922b31ebbdc6d8cbfe76bebbaa158cf16b9e7b0c (patch)
treeac25404691b21304bb30b3e400da97b6c5671b76 /src/core
parentUpdate README.md (diff)
downloadyuzu-922b31ebbdc6d8cbfe76bebbaa158cf16b9e7b0c.tar.gz
yuzu-922b31ebbdc6d8cbfe76bebbaa158cf16b9e7b0c.tar.xz
yuzu-922b31ebbdc6d8cbfe76bebbaa158cf16b9e7b0c.zip
DiskDirectory: Initialize the directory member with valid info.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/file_sys/disk_archive.cpp6
1 files changed, 4 insertions, 2 deletions
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}