improved FindFile so it stops on a match

This commit is contained in:
oy 2011-04-07 18:45:24 +02:00
parent f38fc81d78
commit de1e8fc851

View file

@ -304,6 +304,8 @@ public:
str_format(aPath, sizeof(aPath), "%s/%s", Data.pPath, pName);
Data.pPath = aPath;
fs_listdir(Data.pStorage->GetPath(Type, aPath, aBuf, sizeof(aBuf)), FindFileCallback, Type, &Data);
if(Data.pBuffer[0])
return 1;
}
else if(!str_comp(pName, Data.pFilename))
{
@ -333,7 +335,11 @@ public:
{
// search within all available directories
for(int i = 0; i < m_NumPaths; ++i)
{
fs_listdir(GetPath(i, pPath, aBuf, sizeof(aBuf)), FindFileCallback, i, &Data);
if(pBuffer[0])
return true;
}
}
else if(Type >= 0 && Type < m_NumPaths)
{