* g-diopit.adb (Find): Fix test to exit the iterator and make sure that
the iterator is quitting iteration on parent directory.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108291
138bc75d-0d04-0410-961f-
82ee72b054a4
is
File_Regexp : constant Regexp.Regexp := Regexp.Compile (File_Pattern);
Index : Natural := 0;
+ Quit : Boolean;
procedure Read_Directory (Directory : Dir_Name_Str);
-- Open Directory and read all entries. This routine is called
Dir : Dir_Type;
Buffer : String (1 .. 2_048);
Last : Natural;
- Quit : Boolean;
begin
Open (Dir, Directory);
begin
if Regexp.Match (Dir_Entry, File_Regexp) then
- Quit := False;
Index := Index + 1;
begin
and then OS_Lib.Is_Directory (Pathname)
then
Read_Directory (Pathname);
+ exit when Quit;
end if;
end;
end loop;
end Read_Directory;
begin
+ Quit := False;
Read_Directory (Root_Directory);
end Find;