From a09414424bd4a5f952b2f6b4c2cd538d7abb3f28 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Thu, 2 Jun 2022 00:02:01 +0100 Subject: [PATCH] Fix broken VFS directory creation --- app/src/main/cpp/skyline/vfs/os_filesystem.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/cpp/skyline/vfs/os_filesystem.cpp b/app/src/main/cpp/skyline/vfs/os_filesystem.cpp index dd367855..c69093cd 100644 --- a/app/src/main/cpp/skyline/vfs/os_filesystem.cpp +++ b/app/src/main/cpp/skyline/vfs/os_filesystem.cpp @@ -39,14 +39,16 @@ namespace skyline::vfs { } bool OsFileSystem::CreateDirectoryImpl(const std::string &path, bool parents) { + auto fullPath{basePath + path}; + if (!parents) { - int ret{mkdir(path.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)}; + int ret{mkdir(fullPath.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)}; return ret == 0 || errno == EEXIST; } - for (auto dir{basePath.begin()}; dir != basePath.end(); dir++) { - auto nextDir{std::find(dir, basePath.end(), '/')}; - auto nextPath{"/" + std::string(basePath.begin(), nextDir)}; + for (auto dir{fullPath.begin()}; dir != fullPath.end(); dir++) { + auto nextDir{std::find(dir, fullPath.end(), '/')}; + auto nextPath{"/" + std::string(fullPath.begin(), nextDir)}; int ret{mkdir(nextPath.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)}; if (ret < 0 && errno != EEXIST && errno != EPERM)