]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
fix: Fix implementation of unsetenv on Windows (#1171)
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>
Wed, 5 Oct 2022 05:31:52 +0000 (08:31 +0300)
committerGitHub <noreply@github.com>
Wed, 5 Oct 2022 05:31:52 +0000 (07:31 +0200)
src/Util.cpp

index 2d9bb3b733afd21fcb85e11d33771c29ffb178e9..5dde0017c18ab6c50e385dd1fdd09beb01a15e25 100644 (file)
@@ -1364,6 +1364,8 @@ unsetenv(const std::string& name)
 {
 #ifdef HAVE_UNSETENV
   ::unsetenv(name.c_str());
+#elif defined(_WIN32)
+  SetEnvironmentVariable(name.c_str(), NULL);
 #else
   putenv(strdup(name.c_str())); // Leak to environment.
 #endif