fixed extra incursions of ROM extension searches

This commit is contained in:
unknown 2015-11-13 22:00:26 -05:00
parent a476d4c36e
commit a061bdb5dc
1 changed files with 10 additions and 3 deletions

View File

@ -567,6 +567,7 @@ void CRomBrowser::AddFileNameToList(strlist & FileList, const stdstr & Directory
stdstr FileName = Directory + Name + Extension; stdstr FileName = Directory + Name + Extension;
FileName.ToLower(); FileName.ToLower();
FileList.push_back(FileName); FileList.push_back(FileName);
break;
} }
} }
} }
@ -586,8 +587,8 @@ void CRomBrowser::FillRomList(strlist & FileList, const CPath & BaseDirectory, c
do do
{ {
uint8_t ext_ID; uint8_t ext_ID;
int8_t new_list_entry = 0;
const uint8_t exts = sizeof(ROM_extensions) / sizeof(ROM_extensions[0]); const uint8_t exts = sizeof(ROM_extensions) / sizeof(ROM_extensions[0]);
rom_entry_begin:
//TODO: Fix exception on Windows XP (Visual Studio 2010+) //TODO: Fix exception on Windows XP (Visual Studio 2010+)
//WriteTraceF(TraceDebug,__FUNCTION__ ": 2 %s m_StopRefresh = %d",(LPCSTR)SearchPath,m_StopRefresh); //WriteTraceF(TraceDebug,__FUNCTION__ ": 2 %s m_StopRefresh = %d",(LPCSTR)SearchPath,m_StopRefresh);
@ -612,10 +613,16 @@ rom_entry_begin:
{ {
if (Extension == ROM_extensions[ext_ID] && Extension != "7z") if (Extension == ROM_extensions[ext_ID] && Extension != "7z")
{ {
AddRomToList(SearchPath, lpLastRom); new_list_entry = 1;
goto rom_entry_begin; break;
} }
} }
if (new_list_entry)
{
AddRomToList(SearchPath, lpLastRom);
continue;
}
if (Extension == "7z") if (Extension == "7z")
{ {
try try