diff --git a/Source/Core/Common/Src/StringUtil.cpp b/Source/Core/Common/Src/StringUtil.cpp index 4de1fa71cc..e5a42dc3fb 100644 --- a/Source/Core/Common/Src/StringUtil.cpp +++ b/Source/Core/Common/Src/StringUtil.cpp @@ -449,3 +449,14 @@ std::string ThS(int Integer, bool Unsigned) } return sbuf; } + +void NormalizeDirSep(std::string* str) +{ +#ifdef _WIN32 + int i; + while ((i = (int)str->find_first_of('\\')) >= 0) + { + str->replace(i, 1, DIR_SEP); + } +#endif +} \ No newline at end of file diff --git a/Source/Core/Common/Src/StringUtil.h b/Source/Core/Common/Src/StringUtil.h index 3dc1eebe98..4dbcc7ff8e 100644 --- a/Source/Core/Common/Src/StringUtil.h +++ b/Source/Core/Common/Src/StringUtil.h @@ -73,6 +73,6 @@ int ChooseStringFrom(const char* str, const char* * items); // filehelper bool SplitPath(const std::string& full_path, std::string* _pPath, std::string* _pFilename, std::string* _pExtension); void BuildCompleteFilename(std::string& _CompleteFilename, const std::string& _Path, const std::string& _Filename); - +void NormalizeDirSep(std::string* str); #endif // _STRINGUTIL_H_ diff --git a/Source/Core/DolphinWX/Src/GameListCtrl.cpp b/Source/Core/DolphinWX/Src/GameListCtrl.cpp index 03045bcfa9..f0e3d7cfcf 100644 --- a/Source/Core/DolphinWX/Src/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/Src/GameListCtrl.cpp @@ -384,7 +384,21 @@ void CGameListCtrl::ScanForISOs() for (u32 j = 0; j < FST_Temp.children.size(); j++) { if (FST_Temp.children.at(j).isDirectory) - Directories.push_back(FST_Temp.children.at(j).physicalName.c_str()); + { + bool duplicate = false; + NormalizeDirSep(&(FST_Temp.children.at(j).physicalName)); + for (u32 k = 0; k < Directories.size(); k++) + { + NormalizeDirSep(&Directories.at(k)); + if (strcmp(Directories.at(k).c_str(), FST_Temp.children.at(j).physicalName.c_str()) == 0) + { + duplicate = true; + break; + } + } + if (!duplicate) + Directories.push_back(FST_Temp.children.at(j).physicalName.c_str()); + } } } }