LazUtils: Make TFileSearcher match all files with *.* on Windows like FindFirst + FindNext do. Issue #24306

git-svn-id: trunk@40873 -
This commit is contained in:
juha 2013-04-22 07:59:02 +00:00
parent f125213df5
commit 07d79d2536

View File

@ -1447,17 +1447,20 @@ var
(PathInfo.Name = '') then Continue; (PathInfo.Name = '') then Continue;
// Deal with both files and directories // Deal with both files and directories
if (PathInfo.Attr and faDirectory) = 0 then if (PathInfo.Attr and faDirectory) = 0 then
begin begin // File
if (MaskList = nil) or MaskList.Matches(PathInfo.Name) then if (MaskList = nil) or MaskList.Matches(PathInfo.Name)
begin {$IFDEF Windows}
// On Windows files without extension must be included for *.*
or ((ASearchMask = AllFilesMask) and (ExtractFileExt(PathInfo.Name) = ''))
{$ENDIF}
then begin
FPath := APath; FPath := APath;
FLevel := ALevel; FLevel := ALevel;
FFileInfo := PathInfo; FFileInfo := PathInfo;
DoFileFound; DoFileFound;
end; end;
end end
else else begin // Directory
begin
FPath := APath; FPath := APath;
FLevel := ALevel; FLevel := ALevel;
FFileInfo := PathInfo; FFileInfo := PathInfo;