diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-12-09 17:18:03 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-12-09 17:18:03 +0000 |
commit | 506dd208ca621acd44d3033eb2d9eb2387fa2539 (patch) | |
tree | aa9d0a6351cd6720e0f17a2de235417db836a847 | |
parent | 9036a87da04182f4df1e9f3f7cc4205aa3454983 (diff) | |
download | gcc-506dd208ca621acd44d3033eb2d9eb2387fa2539.tar.gz |
2005-12-05 Pascal Obry <obry@adacore.com>
* 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
-rw-r--r-- | gcc/ada/g-diopit.adb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/ada/g-diopit.adb b/gcc/ada/g-diopit.adb index 92c7be128be..d57ca385832 100644 --- a/gcc/ada/g-diopit.adb +++ b/gcc/ada/g-diopit.adb @@ -51,6 +51,7 @@ package body GNAT.Directory_Operations.Iteration is 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 @@ -80,7 +81,6 @@ package body GNAT.Directory_Operations.Iteration is Dir : Dir_Type; Buffer : String (1 .. 2_048); Last : Natural; - Quit : Boolean; begin Open (Dir, Directory); @@ -96,7 +96,6 @@ package body GNAT.Directory_Operations.Iteration is begin if Regexp.Match (Dir_Entry, File_Regexp) then - Quit := False; Index := Index + 1; begin @@ -116,6 +115,7 @@ package body GNAT.Directory_Operations.Iteration is and then OS_Lib.Is_Directory (Pathname) then Read_Directory (Pathname); + exit when Quit; end if; end; end loop; @@ -124,6 +124,7 @@ package body GNAT.Directory_Operations.Iteration is end Read_Directory; begin + Quit := False; Read_Directory (Root_Directory); end Find; |