[Cmake-commits] [cmake-commits] hoffman committed cmSystemTools.h 1.159 1.160 cmSystemTools.cxx 1.395 1.396

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Jun 5 12:01:31 EDT 2009


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv10575

Modified Files:
	cmSystemTools.h cmSystemTools.cxx 
Log Message:
ENH: move PutEnv to SystemTools 


Index: cmSystemTools.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSystemTools.h,v
retrieving revision 1.159
retrieving revision 1.160
diff -C 2 -d -r1.159 -r1.160
*** cmSystemTools.h	21 Apr 2009 15:36:58 -0000	1.159
--- cmSystemTools.h	5 Jun 2009 16:01:29 -0000	1.160
***************
*** 338,345 ****
    static std::string RelativePath(const char* local, const char* remote);
  
-   /** Put a string into the environment
-       of the form var=value */
-   static bool PutEnv(const char* value);
- 
  #ifdef CMAKE_BUILD_WITH_CMAKE
    /** Remove an environment variable */
--- 338,341 ----

Index: cmSystemTools.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSystemTools.cxx,v
retrieving revision 1.395
retrieving revision 1.396
diff -C 2 -d -r1.395 -r1.396
*** cmSystemTools.cxx	24 Apr 2009 15:44:42 -0000	1.395
--- cmSystemTools.cxx	5 Jun 2009 16:01:29 -0000	1.396
***************
*** 1607,1636 ****
  }
  
- class cmDeletingCharVector : public std::vector<char*>
- {
- public:
-   ~cmDeletingCharVector()
-     {
-       for(std::vector<char*>::iterator i = this->begin();
-           i != this->end(); ++i)
-         {
-         delete []*i;
-         }
-     }
- };
- 
-         
- bool cmSystemTools::PutEnv(const char* value)
- { 
-   static cmDeletingCharVector localEnvironment;
-   char* envVar = new char[strlen(value)+1];
-   strcpy(envVar, value);
-   int ret = putenv(envVar);
-   // save the pointer in the static vector so that it can
-   // be deleted on exit
-   localEnvironment.push_back(envVar);
-   return ret == 0;
- }
- 
  #ifdef CMAKE_BUILD_WITH_CMAKE
  //----------------------------------------------------------------------
--- 1607,1610 ----



More information about the Cmake-commits mailing list