]> Creatis software - gdcm.git/blobdiff - src/gdcmArgMgr.cxx
UserDefinedFileIdentifier is now more human readable
[gdcm.git] / src / gdcmArgMgr.cxx
index d966c558062dce4ae8ebabca23c90e8b91d439b0..6ec2636714bcd128bb419a48c8c38366a63058d3 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmArgMgr.cxx,v $
   Language:  C++
-  Date:      $Date: 2006/01/26 18:26:04 $
-  Version:   $Revision: 1.19 $
+  Date:      $Date: 2007/05/23 14:18:07 $
+  Version:   $Revision: 1.24 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -21,8 +21,9 @@
 #include <ctype.h>
 #include <string.h>  // For strlen
 
-// No strcasecmp in borland, but stricmp
-#ifdef __BORLANDC__
+// No strcasecmp in WIN32 world, but stricmp
+// http://www.opengroup.org/onlinepubs/007908799/xsh/strcasecmp.html
+#ifdef _WIN32
 #define strcasecmp stricmp
 #endif
 
@@ -31,7 +32,7 @@
 
 #include "gdcmArgMgr.h"
 
-namespace gdcm 
+namespace GDCM_NAME_SPACE 
 {
 //-------------------------------------------------------------------------
 // Constructor / Destructor
@@ -98,8 +99,13 @@ namespace gdcm
    }
 
    /* Set labels to upper-case (labels are not case sensitive ) *********/
+   //char *secu;
    for ( i=0; i<ArgCount; i++)
+   {
+      //secu = ArgLab[i];
       ArgLab[i] = Majuscule ( ArgLab[i] ) ;
+      //free (secu); //we still need it in the caller pgm.
+   }
 
   /* Standard arguments are managed by ArgStdArgs **********************/
    ArgStdArgs(); 
@@ -136,6 +142,7 @@ int ArgMgr::ArgMgrDefined( const char *param )
     trouve = ( strcmp( ArgLab[i], temp )==0 ) ;
     if ( trouve )
     {
+      free (temp);
       ArgUsed[i] = true ;           
       for ( int j=1; j<i; j++)
       {                     
@@ -143,8 +150,9 @@ int ArgMgr::ArgMgrDefined( const char *param )
             ArgUsed[j] = i ;
       }
       return i ;
-    }
+    }   
   }
+  free (temp);
   return 0 ;
 }