mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
improved FindFile so it stops on a match
This commit is contained in:
parent
f38fc81d78
commit
de1e8fc851
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue