From: Stanislav Malyshev Date: Wed, 21 Feb 2007 03:03:37 +0000 (+0000) Subject: fix putenv - if there was no previous, remove variable from environ X-Git-Tag: php-5.2.2RC1~344 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=462d545a638f9e7d8d732a3d6a65926beefd59f4;p=php fix putenv - if there was no previous, remove variable from environ --- diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 0a0009d133..8d6f45005a 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -3851,6 +3851,10 @@ static void php_putenv_destructor(putenv_entry *pe) # if HAVE_UNSETENV unsetenv(pe->key); # elif defined(PHP_WIN32) + char *del_string = emalloc(pe->key_len+2); + snprintf(del_string, pe->key_len+2, "%s=", pe->key); + putenv(del_string); + efree(del_string); SetEnvironmentVariable(pe->key, NULL); # else char **env;