mirror of
https://github.com/libretro/ppsspp.git
synced 2024-12-12 10:56:45 +00:00
Merge pull request #472 from KentuckyCompass/fixpathcase_strlen
std::string is not UTF8-aware
This commit is contained in:
commit
bc1832dfdd
@ -37,7 +37,7 @@ static bool FixFilenameCase(const std::string &path, std::string &filename)
|
||||
if (File::Exists(path + filename))
|
||||
return true;
|
||||
|
||||
size_t filenameSize = filename.size();
|
||||
size_t filenameSize = filename.size(); // size in bytes, not characters
|
||||
for (size_t i = 0; i < filenameSize; i++)
|
||||
{
|
||||
filename[i] = tolower(filename[i]);
|
||||
@ -57,7 +57,6 @@ static bool FixFilenameCase(const std::string &path, std::string &filename)
|
||||
|
||||
while (!readdir_r(dirp, (dirent*) &diren, &result) && result)
|
||||
{
|
||||
// Hm, is this check UTF-8 compatible? (size vs strlen)
|
||||
if (strlen(result->d_name) != filenameSize)
|
||||
continue;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user