فهرست منبع

cmSystemTools: Fix unsetenv() fallback

The fallback path boils down to putenv(). Calling that with a "=" sets the
variable to an empty string.
Use cmSystemTools::UnPutEnv() instead, which correctly handles unsetting
variables on a variety of systems.
Raul Tambre 3 سال پیش
والد
کامیت
8eb8d16c19
1فایلهای تغییر یافته به همراه1 افزوده شده و 2 حذف شده
  1. 1 2
      Source/cmSystemTools.cxx

+ 1 - 2
Source/cmSystemTools.cxx

@@ -1501,8 +1501,7 @@ std::string cmSystemTools::RelativeIfUnder(std::string const& top,
 bool cmSystemTools::UnsetEnv(const char* value)
 {
 #  if !defined(HAVE_UNSETENV)
-  std::string var = cmStrCat(value, '=');
-  return cmSystemTools::PutEnv(var);
+  return cmSystemTools::UnPutEnv(value);
 #  else
   unsetenv(value);
   return true;