iliaa           Tue May  6 18:04:25 2008 UTC

  Modified files:              
    /php-src/ext/standard       basic_functions.c 
  Log:
  MFB: Fixed bug #44836 (putenv() crashes, avoid direct reference of environ
  in POSIX systems).
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.897&r2=1.898&diff_format=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.897 
php-src/ext/standard/basic_functions.c:1.898
--- php-src/ext/standard/basic_functions.c:1.897        Mon May  5 06:28:03 2008
+++ php-src/ext/standard/basic_functions.c      Tue May  6 18:04:25 2008
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: basic_functions.c,v 1.897 2008/05/05 06:28:03 kalle Exp $ */
+/* $Id: basic_functions.c,v 1.898 2008/05/06 18:04:25 iliaa Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -3822,9 +3822,7 @@
                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);
@@ -4388,12 +4386,8 @@
                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 */
+                               /* must copy previous value because putenv can 
free the string without notice */
                                pe.previous_value = estrdup(*env);
-#else
-                               pe.previous_value = *env;
-#endif
                                break;
                        }
                }



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

Reply via email to