diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 3b63e8716..28662a9a3 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 cmSystemTools::GetEnvironmentVariables()