edink Sun Dec 10 01:24:13 2006 UTC
Modified files:
/php-src/ext/standard basic_functions.c
Log:
MFB: Fixed by #39751 by KevinJohnHoffman at gmail dot com
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.830&r2=1.831&diff_format=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.830
php-src/ext/standard/basic_functions.c:1.831
--- php-src/ext/standard/basic_functions.c:1.830 Wed Dec 6 17:42:47 2006
+++ php-src/ext/standard/basic_functions.c Sun Dec 10 01:24:13 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.830 2006/12/06 17:42:47 tony2001 Exp $ */
+/* $Id: basic_functions.c,v 1.831 2006/12/10 01:24:13 edink Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -3852,6 +3852,9 @@
SetEnvironmentVariable(pe->key, "bugbug");
#endif
putenv(pe->previous_value);
+# if defined(PHP_WIN32)
+ efree(pe->previous_value);
+# endif
} else {
# if HAVE_UNSETENV
unsetenv(pe->key);
@@ -4419,7 +4422,12 @@
pe.previous_value = NULL;
for (env = environ; env != NULL && *env != NULL; env++) {
if (!strncmp(*env, pe.key, pe.key_len) &&
(*env)[pe.key_len] == '=') { /* found it */
+#if defined(PHP_WIN32)
+ /* must copy previous value because MSVCRT's
putenv can free the string without notice */
+ pe.previous_value = estrndup(*env, 1024);
+#else
pe.previous_value = *env;
+#endif
break;
}
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php