pajoye Wed Aug 20 22:19:57 2008 UTC
Modified files:
/php-src/ext/standard basic_functions.c
Log:
- work around ENV VC6 bug
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.923&r2=1.924&diff_format=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.923
php-src/ext/standard/basic_functions.c:1.924
--- php-src/ext/standard/basic_functions.c:1.923 Wed Aug 20 09:00:37 2008
+++ php-src/ext/standard/basic_functions.c Wed Aug 20 22:19:57 2008
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.923 2008/08/20 09:00:37 tony2001 Exp $ */
+/* $Id: basic_functions.c,v 1.924 2008/08/20 22:19:57 pajoye Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -4446,6 +4446,7 @@
#ifdef PHP_WIN32
char *value = NULL;
int equals = 0;
+ int error_code;
#endif
pe.putenv_string = estrndup(setting, setting_len);
@@ -4495,7 +4496,14 @@
# ifndef PHP_WIN32
if (putenv(pe.putenv_string) == 0) { /* success */
# else
- if (SetEnvironmentVariableA(pe.key, value) != 0) { /* success */
+ error_code = SetEnvironmentVariable(pe.key, value);
+# if _MSC_VER < 1500
+ /* Yet another VC6 bug, unset may return env not found */
+ if (error_code != 0 ||
+ (error_code == 0 && GetLastError() ==
ERROR_ENVVAR_NOT_FOUND)) {
+# else
+ if (error_code != 0) { /* success */
+# endif
# endif
#endif
zend_hash_add(&BG(putenv_ht), pe.key, pe.key_len + 1,
(void **) &pe, sizeof(putenv_entry), NULL);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php