-fixed reading in scummvm game list for sure now,

shouldn't codedump anymore with too long game titles,
games from usb should also work fine now
This commit is contained in:
fix94.1 2012-04-21 15:41:18 +00:00
parent ac5ffef989
commit 9d9636f080

View File

@ -123,17 +123,18 @@ safe_vector<dir_discHdr> Plugin::ParseScummvmINI(Config &ini, string Device)
dir_discHdr tmp; dir_discHdr tmp;
while(1) while(1)
{ {
if(game != emptyString && (lowerCase(game).rfind("scummvm") != string::npos if(game == emptyString)
|| lowerCase(ini.getString(game, "path")).rfind(Device) == string::npos)) break;
if(strncasecmp(game.c_str(), "/", 1) == 0 ||
lowerCase(game).rfind("scummvm") != string::npos ||
lowerCase(ini.getStrings(game, "path", '/')[0]).rfind(Device.c_str()) == string::npos)
{ {
game = ini.nextDomain(); game = ini.nextDomain();
continue; continue;
} }
if(game == emptyString)
break;
memset(&tmp, 0, sizeof(dir_discHdr)); memset(&tmp, 0, sizeof(dir_discHdr));
tmp.hdr.casecolor = caseColors.back(); tmp.hdr.casecolor = caseColors.back();
mbstowcs(tmp.title, ini.getString(game,"description").c_str(), sizeof(tmp.title)); mbstowcs(tmp.title, ini.getString(game,"description").c_str(), 64);
strncpy(tmp.path, game.c_str(), sizeof(tmp.path)); strncpy(tmp.path, game.c_str(), sizeof(tmp.path));
gprintf("Found: %s\n", ini.getString(game,"description").c_str()); gprintf("Found: %s\n", ini.getString(game,"description").c_str());
tmp.hdr.magic = magicWords.back(); tmp.hdr.magic = magicWords.back();