summaryrefslogtreecommitdiffstats
path: root/Source/cmCLocaleEnvironmentScope.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmCLocaleEnvironmentScope.cxx')
-rw-r--r--Source/cmCLocaleEnvironmentScope.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/cmCLocaleEnvironmentScope.cxx b/Source/cmCLocaleEnvironmentScope.cxx
index ee9acde..e4c74ec 100644
--- a/Source/cmCLocaleEnvironmentScope.cxx
+++ b/Source/cmCLocaleEnvironmentScope.cxx
@@ -31,8 +31,9 @@ cmCLocaleEnvironmentScope::cmCLocaleEnvironmentScope()
std::string cmCLocaleEnvironmentScope::GetEnv(std::string const& key)
{
- const char* value = cmSystemTools::GetEnv(key);
- return value ? value : std::string();
+ std::string value;
+ cmSystemTools::GetEnv(key, value);
+ return value;
}
void cmCLocaleEnvironmentScope::SetEnv(std::string const& key,
@@ -45,7 +46,7 @@ void cmCLocaleEnvironmentScope::SetEnv(std::string const& key,
if (value.empty()) {
cmSystemTools::UnsetEnv(key.c_str());
} else {
- std::stringstream tmp;
+ std::ostringstream tmp;
tmp << key << "=" << value;
cmSystemTools::PutEnv(tmp.str());
}
@@ -55,7 +56,7 @@ cmCLocaleEnvironmentScope::~cmCLocaleEnvironmentScope()
{
for (backup_map_t::const_iterator i = this->EnvironmentBackup.begin();
i != this->EnvironmentBackup.end(); ++i) {
- std::stringstream tmp;
+ std::ostringstream tmp;
tmp << i->first << "=" << i->second;
cmSystemTools::PutEnv(tmp.str());
}