From 90167abe0fb7a3dd0ec142096dff14efef192685 Mon Sep 17 00:00:00 2001 From: Stevoisiak Date: Sat, 21 Mar 2015 17:31:29 -0400 Subject: [PATCH] Improve parsing custom game titles from titles.txt Read game ID based on position of the "=" sign, rather than assuming game IDs are 6 characters in length. --- Source/Core/DolphinWX/GameListCtrl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Core/DolphinWX/GameListCtrl.cpp b/Source/Core/DolphinWX/GameListCtrl.cpp index 5983238240..f997b2a9e7 100644 --- a/Source/Core/DolphinWX/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/GameListCtrl.cpp @@ -407,9 +407,10 @@ void CGameListCtrl::InsertItemInReportView(long _Index) if (!std::getline(titlestxt, line) && titlestxt.eof()) break; - if (line.substr(0,rISOFile.GetUniqueID().size()) == rISOFile.GetUniqueID()) + const size_t equals_index = line.find('='); + if (line.substr(0, equals_index - 1) == rISOFile.GetUniqueID()) { - name = StrToWxStr(line.substr(rISOFile.GetUniqueID().size() + 3)); + name = StrToWxStr(line.substr(equals_index + 2)); break; } }