diff options
author | Wez Furlong <wez@php.net> | 2004-04-22 14:26:03 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2004-04-22 14:26:03 +0000 |
commit | 73f49c16f4b97341a4c26f237e3f82bf2b842902 (patch) | |
tree | b4e695ec62f4fe5251598c8f56f089d772683f27 /ext/standard/basic_functions.c | |
parent | 9833b429d6bdf961cb23d50d66368d7e44e05457 (diff) | |
download | php-git-73f49c16f4b97341a4c26f237e3f82bf2b842902.tar.gz |
The fix for the vc7 libc putenv bug is also needed here to avoid a crash.
Diffstat (limited to 'ext/standard/basic_functions.c')
-rw-r--r-- | ext/standard/basic_functions.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 18d799fdd3..3106022f3d 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -886,6 +886,13 @@ zend_module_entry basic_functions_module = { 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 |