From ea2690d667d0bb94dabed8206e8df7625e38a490 Mon Sep 17 00:00:00 2001 From: Ken Martin Date: Fri, 7 Sep 2001 10:08:03 -0400 Subject: fixed bug in mismatched directory opens consuming file descriptors --- Source/cmDirectory.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Source/cmDirectory.cxx b/Source/cmDirectory.cxx index 8fbabc6..09f18fb 100644 --- a/Source/cmDirectory.cxx +++ b/Source/cmDirectory.cxx @@ -54,7 +54,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include - /** * @@ -111,12 +110,12 @@ cmDirectory ::Load(const char* name) { DIR* dir = opendir(name); - if ( !dir ) + + if (!dir) { return 0; } - - dir = opendir(name); + for (dirent* d = readdir(dir); d; d = readdir(dir) ) { m_Files.push_back(d->d_name); -- cgit v0.12