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