php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #69033
Patch bug69033_2.patch revision 2015-02-12 11:19 UTC by ab@php.net
Patch bug69033_1.patch revision 2015-02-12 09:22 UTC by ab@php.net

Patch bug69033_1.patch for Scripting Engine problem Bug #69033

Patch version 2015-02-12 09:22 UTC

Return to Bug #69033 | Download this patch
This patch is obsolete

Obsoleted by patches:

Patch Revisions:

Developer: ab@php.net

diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index dad815b..954a532 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -3432,7 +3432,18 @@ static void php_putenv_destructor(putenv_entry *pe) /* {{{ */
 # if HAVE_UNSETENV
 		unsetenv(pe->key);
 # elif defined(PHP_WIN32)
+#  ifndef ZTS
+		int key_len = strlen(pe->key);
+		char *putenv_string = (char *) emalloc(key_len + 2);
+#  endif
 		SetEnvironmentVariable(pe->key, NULL);
+#  ifndef ZTS
+		memcpy(putenv_string, pe->key, key_len);
+		putenv_string[key_len] = '=';
+		putenv_string[key_len + 1] = '\0';
+		_putenv(putenv_string);
+		efree(putenv_string);
+#  endif
 # else
 		char **env;
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 12:01:29 2024 UTC