|
@@ -2155,7 +2155,8 @@ begin
|
|
|
Result :=[];
|
|
|
if (FindFirst(IntPath + aSearchPattern, TFile.FileAttributesToInteger(SearchAttributes), SearchRec) = 0) then
|
|
|
repeat
|
|
|
- if (aSearchOption = TSearchOption.soAllDirectories) and ((SearchRec.Attr and {$IFDEF FPC_DOTTEDUNITS}System.{$ENDIF}SysUtils.faDirectory) <> 0) then
|
|
|
+ if (aSearchOption = TSearchOption.soAllDirectories) and ((SearchRec.Attr and {$IFDEF FPC_DOTTEDUNITS}System.{$ENDIF}SysUtils.faDirectory) <> 0)
|
|
|
+ and (SearchRec.Name <> '.') and (SearchRec.Name <> '..') then
|
|
|
Result:=Result + GetFilesAndDirectories(IntPath + SearchRec.Name, aSearchPattern, aSearchOption, SearchAttributes, aPredicate)
|
|
|
else if FilterPredicate(aPath, SearchRec) then
|
|
|
Result:=Result + [IntPath + SearchRec.Name];
|