From d9b0b56e3e7f2eeb382884f189305a07f7b39753 Mon Sep 17 00:00:00 2001 From: DHrpcs3 Date: Sat, 29 Nov 2014 17:15:26 +0200 Subject: [PATCH] Using strcmp instead stricmp --- rpcs3/Emu/FS/VFS.cpp | 11 +++++++---- rpcs3/Emu/FS/vfsDir.cpp | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/rpcs3/Emu/FS/VFS.cpp b/rpcs3/Emu/FS/VFS.cpp index 884290142a..82e188ada3 100644 --- a/rpcs3/Emu/FS/VFS.cpp +++ b/rpcs3/Emu/FS/VFS.cpp @@ -21,7 +21,10 @@ int sort_devices(const void* _a, const void* _b) std::vector simplify_path_blocks(const std::string& path) { - std::vector path_blocks = std::move(fmt::split(path, { "/", "\\" })); + std::string lower_path = path; + std::transform(lower_path.begin(), lower_path.end(), lower_path.begin(), ::tolower); + + std::vector path_blocks = std::move(fmt::split(lower_path, { "/", "\\" })); for (size_t i = 0; i < path_blocks.size(); ++i) { @@ -100,7 +103,7 @@ void VFS::UnMount(const std::string& ps3_path) for (u32 i = 0; i < m_devices.size(); ++i) { - if (!stricmp(m_devices[i]->GetPs3Path().c_str(), simpl_ps3_path.c_str())) + if (!strcmp(m_devices[i]->GetPs3Path().c_str(), simpl_ps3_path.c_str())) { delete m_devices[i]; @@ -297,7 +300,7 @@ vfsDevice* VFS::GetDevice(const std::string& ps3_path, std::string& path) const size_t eq = 0; for (; eq < dev_ps3_path_blocks.size(); ++eq) { - if (stricmp(ps3_path_blocks[eq].c_str(), dev_ps3_path_blocks[eq].c_str())) + if (strcmp(ps3_path_blocks[eq].c_str(), dev_ps3_path_blocks[eq].c_str())) { break; } @@ -351,7 +354,7 @@ vfsDevice* VFS::GetDeviceLocal(const std::string& local_path, std::string& path) size_t eq = 0; for (; eq < dev_local_path_blocks_blocks.size(); ++eq) { - if (stricmp(local_path_blocks[eq].c_str(), dev_local_path_blocks_blocks[eq].c_str())) + if (strcmp(local_path_blocks[eq].c_str(), dev_local_path_blocks_blocks[eq].c_str())) { break; } diff --git a/rpcs3/Emu/FS/vfsDir.cpp b/rpcs3/Emu/FS/vfsDir.cpp index 13025e51e7..4dac75d851 100644 --- a/rpcs3/Emu/FS/vfsDir.cpp +++ b/rpcs3/Emu/FS/vfsDir.cpp @@ -84,7 +84,7 @@ bool vfsDir::IsExists(const std::string& path) const for (const auto entry : vfsDir(path + "/..")) { - if (!stricmp(entry->name.c_str(), dir_name.c_str())) + if (!strcmp(entry->name.c_str(), dir_name.c_str())) return true; }