mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 04:39:36 +02:00
Merged revision(s) 48854 #a64855cad9, 48858 #b727702265 from trunk:
LazUtils: TFileSearcher.Search: if SearchPath is empty, search current directory. ........ LazUtils: TFileSearcher.Search: do not remove directories that are subdirectories of another directory rom ASearchPath, when ASearchSubDirs is False. Issue #0027965. ........ git-svn-id: branches/fixes_1_4@48863 -
This commit is contained in:
parent
64bec6f450
commit
68ad043d77
@ -1156,21 +1156,27 @@ begin
|
||||
begin
|
||||
OtherDir:=SearchDirectories[i];
|
||||
if (CompareFilenames(Dir,OtherDir)=0)
|
||||
or (FileIsInPath(Dir,OtherDir)) then
|
||||
or (ASearchSubDirs and (FileIsInPath(Dir,OtherDir))) then
|
||||
begin
|
||||
// directory Dir is already searched
|
||||
Dir:='';
|
||||
break;
|
||||
end;
|
||||
if FileIsInPath(OtherDir,Dir) then
|
||||
if ASearchSubDirs and FileIsInPath(OtherDir,Dir) then
|
||||
// directory Dir includes the old directory => delete
|
||||
SearchDirectories.Delete(i);
|
||||
end;
|
||||
if Dir<>'' then
|
||||
SearchDirectories.Add(Dir);
|
||||
end;
|
||||
for i:=0 to SearchDirectories.Count-1 do
|
||||
DoSearch(AppendPathDelim(SearchDirectories[i]), 0);
|
||||
//Search currentdirectory if ASearchPath = ''
|
||||
if (SearchDirectories.Count=0) then
|
||||
DoSearch('',0)
|
||||
else
|
||||
begin
|
||||
for i:=0 to SearchDirectories.Count-1 do
|
||||
DoSearch(AppendPathDelim(SearchDirectories[i]), 0);
|
||||
end;
|
||||
finally
|
||||
SearchDirectories.Free;
|
||||
FSearching := False;
|
||||
|
Loading…
Reference in New Issue
Block a user