cvs: php-src(PHP_5_2) /ext/standard basic_functions.c
| From: | Stanislav Malyshev | Date: | Wed, 21 Feb 2007 03:03:37 +0000 |
| Subject: | cvs: php-src(PHP_5_2) /ext/standard basic_functions.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-43167@lists.php.net to get a copy of this message | ||
stas Wed Feb 21 03:03:37 2007 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/standard basic_functions.c
Log:
fix putenv - if there was no previous, remove variable from environ
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.725.2.31.2.41&r2=1.725.2.31.2.42&diff_format=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.725.2.31.2.41
php-src/ext/standard/basic_functions.c:1.725.2.31.2.42
--- php-src/ext/standard/basic_functions.c:1.725.2.31.2.41 Fri Feb 16 16:35:04 2007
+++ php-src/ext/standard/basic_functions.c Wed Feb 21 03:03:37 2007
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.725.2.31.2.41 2007/02/16 16:35:04 dmitry Exp $ */
+/* $Id: basic_functions.c,v 1.725.2.31.2.42 2007/02/21 03:03:37 stas Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -3851,6 +3851,10 @@
# 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;