wez             Thu Apr 22 10:26:04 2004 EDT

  Modified files:              
    /php-src/ext/standard       basic_functions.c 
  Log:
  The fix for the vc7 libc putenv bug is also needed here to avoid a crash.
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/basic_functions.c?r1=1.663&r2=1.664&ty=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.663 
php-src/ext/standard/basic_functions.c:1.664
--- php-src/ext/standard/basic_functions.c:1.663        Mon Apr 12 08:21:24 2004
+++ php-src/ext/standard/basic_functions.c      Thu Apr 22 10:26:03 2004
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: basic_functions.c,v 1.663 2004/04/12 12:21:24 andi Exp $ */
+/* $Id: basic_functions.c,v 1.664 2004/04/22 14:26:03 wez Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -886,6 +886,13 @@
 static void php_putenv_destructor(putenv_entry *pe)
 {
        if (pe->previous_value) {
+#if _MSC_VER >= 1300
+               /* VS.Net has a bug in putenv() when setting a variable that
+                * is already set; if the SetEnvironmentVariable() API call
+                * fails, the Crt will double free() a string.
+                * We try to avoid this by setting our own value first */
+               SetEnvironmentVariable(pe->key, "bugbug");
+#endif
                putenv(pe->previous_value);
        } else {
 # if HAVE_UNSETENV

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to