From 07d79d253681797ccf593677db0c51a56674b3c5 Mon Sep 17 00:00:00 2001 From: juha Date: Mon, 22 Apr 2013 07:59:02 +0000 Subject: [PATCH] LazUtils: Make TFileSearcher match all files with *.* on Windows like FindFirst + FindNext do. Issue #24306 git-svn-id: trunk@40873 - --- components/lazutils/fileutil.inc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/components/lazutils/fileutil.inc b/components/lazutils/fileutil.inc index 37d47d5f6c..3d35d5783d 100644 --- a/components/lazutils/fileutil.inc +++ b/components/lazutils/fileutil.inc @@ -1447,17 +1447,20 @@ var (PathInfo.Name = '') then Continue; // Deal with both files and directories if (PathInfo.Attr and faDirectory) = 0 then - begin - if (MaskList = nil) or MaskList.Matches(PathInfo.Name) then - begin + begin // File + if (MaskList = nil) or MaskList.Matches(PathInfo.Name) + {$IFDEF Windows} + // On Windows files without extension must be included for *.* + or ((ASearchMask = AllFilesMask) and (ExtractFileExt(PathInfo.Name) = '')) + {$ENDIF} + then begin FPath := APath; FLevel := ALevel; FFileInfo := PathInfo; DoFileFound; end; end - else - begin + else begin // Directory FPath := APath; FLevel := ALevel; FFileInfo := PathInfo;