summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/cmSystemTools.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 3b63e87..28662a9 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1282,7 +1282,18 @@ bool cmSystemTools::PutEnv(const char* value)
bool cmSystemTools::UnsetEnv(const char* value)
{
+#ifdef _WIN32
+ std::string var = value;
+ std::string::size_type pos = var.find("=");
+ if ( pos == var.npos )
+ {
+ continue;
+ }
+ var = var.substr(0, pos+1);
+ return cmSystemTools::PutEnv(var.c_str());
+#else
return unsetenv(value) == 0;
+#endif
}
std::vector<std::string> cmSystemTools::GetEnvironmentVariables()