]> Creatis software - gdcm.git/blobdiff - src/gdcmDirList.cxx
Forget this one
[gdcm.git] / src / gdcmDirList.cxx
index 4504c3e68bb6166671796aa347f95724043bea09..3362843a05e2a779d8007b3e8e784d1ba994b8bc 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDirList.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/14 22:44:39 $
-  Version:   $Revision: 1.36 $
+  Date:      $Date: 2005/01/14 23:51:40 $
+  Version:   $Revision: 1.38 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -93,7 +93,7 @@ int DirList::Explore(std::string const &dirpath, bool recursive)
       fileName = fileData.cFileName;
       if( fileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY )
       {
-         // Is the '.' and '..' usefull ?
+         // Need to check for . and .. to avoid infinite loop
          if( fileName != "." && fileName != ".." && recursive )
          {
             numberOfFiles += Explore(dirName+fileName,recursive);
@@ -105,7 +105,7 @@ int DirList::Explore(std::string const &dirpath, bool recursive)
          numberOfFiles++;
       }
    }
-   if (hFile != INVALID_FILE_HANDLE) FindClose(hFile);
+   if (hFile != INVALID_HANDLE_VALUE) FindClose(hFile);
 
 #else
   // Real POSIX implementation: scandir is a BSD extension only, and doesn't