fs: Actually functional linux case insensitive search

This commit is contained in:
IndecisiveTurtle
2024-07-15 03:37:30 +03:00
parent 26f8fbf628
commit dbeed80e3b
7 changed files with 145 additions and 108 deletions

View File

@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "common/assert.h"
#include "common/logging/log.h"
#include "common/singleton.h"
#include "core/file_sys/fs.h"
#include "core/libraries/libc/libc_stdio.h"
@@ -10,11 +10,12 @@ namespace Libraries::LibC {
std::FILE* PS4_SYSV_ABI ps4_fopen(const char* filename, const char* mode) {
auto* mnt = Common::Singleton<Core::FileSys::MntPoints>::Instance();
FILE* f = std::fopen(mnt->GetHostFile(filename).c_str(), mode);
const auto host_path = mnt->GetHostPath(filename);
FILE* f = std::fopen(host_path.c_str(), mode);
if (f != nullptr) {
LOG_INFO(Lib_LibC, "fopen = {}", mnt->GetHostFile(filename).c_str());
LOG_INFO(Lib_LibC, "fopen = {}", host_path.native());
} else {
LOG_INFO(Lib_LibC, "fopen can't open = {}", mnt->GetHostFile(filename).c_str());
LOG_INFO(Lib_LibC, "fopen can't open = {}", host_path.native());
}
return f;
}