View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003063CMakeCMakepublic2006-03-30 11:492006-10-04 13:35
ReporterJohn Biddiscombe 
Assigned ToBill Hoffman 
PrioritylowSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0003063: Need a SetEnv method to complement GetEnv in SystemTools
Descriptionin .h
  /**
   * Write an environment variable
   */
  static bool SetEnv(const char* key, const char *val, bool overwrite);

in .cxx
bool SystemTools::SetEnv(const char* key, const char *val, bool overwrite)
{
  bool retval;
#ifdef _WIN32
  char *buffer = new char[strlen(val) + strlen(name)];
  sprintf(buffer,"%s=%s",name,val);
  retval = (putenv(buffer)==0);
  delete []buffer;
#else
  retval = (setenv(name, val, overwrite)==0);
#endif
  return retval;
}
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0003934)
John Biddiscombe (reporter)
2006-03-31 02:17

Should have been +2 to cater of null and = chars
  char *buffer = new char[strlen(val) + strlen(name)+2];
(0005150)
Bill Hoffman (manager)
2006-10-04 13:35

 cmSystemTools::PutEnv

 Issue History
Date Modified Username Field Change


Copyright © 2000 - 2018 MantisBT Team