aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/file_sys/archive_sdmc.cpp
diff options
context:
space:
mode:
authorGravatar archshift <admin@archshift.com>2014-12-07 14:40:27 -0800
committerGravatar archshift <admin@archshift.com>2014-12-07 14:47:14 -0800
commit20d2ed09502f41519beb435a1300f2a57995c651 (patch)
tree4d58349bdfc1ab122d522780c1d9692832ce9ad0 /src/core/file_sys/archive_sdmc.cpp
parent17fae11fc7cf9392bb93dd2a1dc26a479ca75ed1 (diff)
Make OpenDirectory fail if the directory doesn't exist
This is in line with what the hardware itself does. It does this by splitting the initial directory opening into Directory.Open(), which will return false if a stat fails. Then, Archive::OpenDirectory will return nullptr, and archive.cpp will return an error code .
Diffstat (limited to 'src/core/file_sys/archive_sdmc.cpp')
-rw-r--r--src/core/file_sys/archive_sdmc.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/file_sys/archive_sdmc.cpp b/src/core/file_sys/archive_sdmc.cpp
index 169ab0f1..fc0b9b72 100644
--- a/src/core/file_sys/archive_sdmc.cpp
+++ b/src/core/file_sys/archive_sdmc.cpp
@@ -100,6 +100,8 @@ bool Archive_SDMC::RenameDirectory(const FileSys::Path& src_path, const FileSys:
std::unique_ptr<Directory> Archive_SDMC::OpenDirectory(const Path& path) const {
DEBUG_LOG(FILESYS, "called path=%s", path.DebugStr().c_str());
Directory_SDMC* directory = new Directory_SDMC(this, path);
+ if (!directory->Open())
+ return nullptr;
return std::unique_ptr<Directory>(directory);
}