TFileSearcher: don't enter subfolder and don't call OnDirectoryEnter when FSearching = False

This commit is contained in:
Bart 2024-02-07 10:40:57 +01:00
parent c95ec9df9f
commit 180dcc8888

View File

@ -899,13 +899,13 @@ var
FPath := APath;
FLevel := ALevel;
FFileInfo := PathInfo;
DoDirectoryEnter;
if not FSearching then Break;
DoDirectoryEnter;
if Assigned(VisitedDirs) then
VisitedDirs.Add(FQDir,'');
DoSearch(AppendPathDelim(APath + PathInfo.Name), Succ(ALevel));
until (FindNextUTF8(PathInfo) <> 0);
until (FindNextUTF8(PathInfo) <> 0) or (not FSearching);
finally
FindCloseUTF8(PathInfo);
end;