mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-12 09:48:30 +12:00
Another mistake
This commit is contained in:
parent
cacd8d471f
commit
832af1c668
1 changed files with 14 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
||||||
#include "FSPath.h"
|
#include "FSPath.h"
|
||||||
|
|
||||||
|
#include <boost/locale/conversion.hpp>
|
||||||
|
|
||||||
#ifdef BOOST_OS_UNIX
|
#ifdef BOOST_OS_UNIX
|
||||||
FSPath operator/ (const FSPath& lhs, const FSPath& rhs)
|
FSPath operator/ (const FSPath& lhs, const FSPath& rhs)
|
||||||
{
|
{
|
||||||
|
@ -22,6 +24,17 @@ FSPath& FSPath::operator/= (const FSPath & rhs)
|
||||||
fs::path relPath = rhs.relative_path();
|
fs::path relPath = rhs.relative_path();
|
||||||
fs::path correctedPath = empty() ? rhs.root_path() : *this;
|
fs::path correctedPath = empty() ? rhs.root_path() : *this;
|
||||||
|
|
||||||
|
// helper function to convert a path's alphabet characters to lowercase.
|
||||||
|
auto static lowercase_path = [](fs::path const & path)
|
||||||
|
{
|
||||||
|
std::string string = path.string();
|
||||||
|
for (auto& i : string)
|
||||||
|
{
|
||||||
|
i = std::isalpha(i) ? std::tolower(i) : i;
|
||||||
|
}
|
||||||
|
return string;
|
||||||
|
};
|
||||||
|
|
||||||
bool found;
|
bool found;
|
||||||
for (auto const &it : relPath)
|
for (auto const &it : relPath)
|
||||||
{
|
{
|
||||||
|
@ -30,7 +43,7 @@ FSPath& FSPath::operator/= (const FSPath & rhs)
|
||||||
for (auto const& dirEntry : fs::directory_iterator{correctedPath, listErr})
|
for (auto const& dirEntry : fs::directory_iterator{correctedPath, listErr})
|
||||||
{
|
{
|
||||||
fs::path entryName = dirEntry.path().filename();
|
fs::path entryName = dirEntry.path().filename();
|
||||||
if (boost::iequals(entryName, it))
|
if (boost::iequals(entryName.string(), it.string()))
|
||||||
{
|
{
|
||||||
correctedPath /= entryName;
|
correctedPath /= entryName;
|
||||||
found = true;
|
found = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue