From 0a6fbcbd58d5e186b183316d8d10d1f07ac0f6cb Mon Sep 17 00:00:00 2001 From: malaterre Date: Wed, 17 Sep 2003 17:46:35 +0000 Subject: [PATCH] * corrected directory parsing under Win32 --- src/gdcmHeaderHelper.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gdcmHeaderHelper.cxx b/src/gdcmHeaderHelper.cxx index 32ada9e5..3b1547e6 100644 --- a/src/gdcmHeaderHelper.cxx +++ b/src/gdcmHeaderHelper.cxx @@ -1,4 +1,4 @@ -// $Header: /cvs/public/gdcm/src/Attic/gdcmHeaderHelper.cxx,v 1.3 2003/09/11 13:44:17 jpr Exp $ +// $Header: /cvs/public/gdcm/src/Attic/gdcmHeaderHelper.cxx,v 1.4 2003/09/17 17:46:35 malaterre Exp $ //This is needed when compiling in debug mode #ifdef _MSC_VER @@ -24,19 +24,22 @@ using namespace std; #include int GetDir(string dPath, list &filenames) { + //For now dPath should have an ending "\" WIN32_FIND_DATA FileData; HANDLE hFile; - hFile = FindFirstFile(dPath.c_str(), &FileData); + hFile = FindFirstFile((dPath+"*").c_str(), &FileData); if ( hFile == INVALID_HANDLE_VALUE ) { //No files ! return false; } - filenames.push_back( FileData.cFileName ); + if( strncmp(FileData.cFileName, ".", 1) != 0 ) + filenames.push_back( dPath+FileData.cFileName ); while( FindNextFile(hFile, &FileData ) != 0) { - filenames.push_back( FileData.cFileName ); + if( strncmp(FileData.cFileName, ".", 1) != 0 ) + filenames.push_back( dPath+FileData.cFileName ); } return true; } -- 2.48.1