diff --git a/Core/FileSystems/DirectoryFileSystem.cpp b/Core/FileSystems/DirectoryFileSystem.cpp index 74b36632ef37..da5a849bd94f 100644 --- a/Core/FileSystems/DirectoryFileSystem.cpp +++ b/Core/FileSystems/DirectoryFileSystem.cpp @@ -262,16 +262,14 @@ bool DirectoryFileHandle::Open(const Path &basePath, std::string &fileName, File return false; } fullName = GetLocalPath(basePath, fileName); - const char *fullNameC = fullName.c_str(); - - DEBUG_LOG(FILESYS, "Case may have been incorrect, second try opening %s (%s)", fullNameC, fileName.c_str()); + DEBUG_LOG(FILESYS, "Case may have been incorrect, second try opening %s (%s)", fullName.c_str(), fileName.c_str()); // And try again with the correct case this time #ifdef _WIN32 - hFile = CreateFile(fullNameC, desired, sharemode, 0, openmode, 0, 0); + hFile = CreateFile(fullName.c_str(), desired, sharemode, 0, openmode, 0, 0); success = hFile != INVALID_HANDLE_VALUE; #else - hFile = open(fullNameC, flags, 0666); + hFile = open(fullName.c_str(), flags, 0666); success = hFile != -1; #endif } diff --git a/Core/PSPLoaders.cpp b/Core/PSPLoaders.cpp index e3ac345d844a..0d30828fe8cd 100644 --- a/Core/PSPLoaders.cpp +++ b/Core/PSPLoaders.cpp @@ -427,7 +427,7 @@ bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string *error_string) { pspFileSystem.SetStartingDirectory(ms_path); } - std::shared_ptr fs = std::shared_ptr(new DirectoryFileSystem(&pspFileSystem, Path(path), FileSystemFlags::SIMULATE_FAT32 | FileSystemFlags::CARD)); + std::shared_ptr fs = std::shared_ptr(new DirectoryFileSystem(&pspFileSystem, full_path.NavigateUp(), FileSystemFlags::SIMULATE_FAT32 | FileSystemFlags::CARD)); pspFileSystem.Mount("umd0:", fs); std::string finalName = ms_path + file;