From b51b639fabe1689b846e49e4cecf618f5f1d22d0 Mon Sep 17 00:00:00 2001 From: juha Date: Mon, 19 Nov 2012 21:51:07 +0000 Subject: [PATCH] LazUtils: reimplement the test for faDirectory in TFileSearcher.Search. FindFirst returns files in any case. git-svn-id: trunk@39312 - --- components/lazutils/fileutil.inc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/components/lazutils/fileutil.inc b/components/lazutils/fileutil.inc index f45e4ae0f9..5096ca09f6 100644 --- a/components/lazutils/fileutil.inc +++ b/components/lazutils/fileutil.inc @@ -1469,7 +1469,7 @@ var // skip special files if (PathInfo.Name = '.') or (PathInfo.Name = '..') or (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 @@ -1492,13 +1492,14 @@ var finally FindCloseUTF8(PathInfo); end; - - if ASearchSubDirs or (ALevel > 0) then // search recursively in directories + + if ASearchSubDirs or (ALevel > 0) then + // search recursively in directories if FindFirstUTF8(P, faDirectory, PathInfo) = 0 then try repeat if (PathInfo.Name = '.') or (PathInfo.Name = '..') or - (PathInfo.Name = '') + (PathInfo.Name = '') or ((PathInfo.Attr and faDirectory) = 0) then Continue; FPath := APath;