]> Creatis software - gdcm.git/commitdiff
ENH: Make sure noone is passing a name ending with a / at the end
authormalaterre <malaterre>
Fri, 15 Apr 2005 21:30:26 +0000 (21:30 +0000)
committermalaterre <malaterre>
Fri, 15 Apr 2005 21:30:26 +0000 (21:30 +0000)
src/gdcmDirList.cxx

index be62fcf1428219caef9b1cb23e33566148c1bc48..27441507d026d2d92e4784151adc082eeffa890d 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDirList.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/04/15 21:21:42 $
-  Version:   $Revision: 1.47 $
+  Date:      $Date: 2005/04/15 21:30:26 $
+  Version:   $Revision: 1.48 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -20,6 +20,7 @@
 #include "gdcmUtil.h"
 
 #include <iterator>
+#include <assert.h>
 
 #ifdef _MSC_VER
    #include <windows.h> 
@@ -62,6 +63,7 @@ DirList::~DirList()
 bool DirList::IsDirectory(std::string const &dirName)
 {
   struct stat fs;
+  assert( dirName[dirName.size()-1] != '/' );
   if(stat(dirName.c_str(), &fs) == 0)
     {
 #if _WIN32