com php-src: Merge branch 'PHP-5.6': ext/standard/basic_funct ions.c
| From: | Anatol Belski | Date: | Fri, 21 Nov 2014 09:25:18 +0000 |
| Subject: | com php-src: Merge branch 'PHP-5.6': ext/standard/basic_funct ions.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-83218@lists.php.net to get a copy of this message | ||
Commit: bcd9c6b25657ee8dfcf7a8975651742ea8a1f280
Author: Anatol Belski <ab@php.net> Fri, 21 Nov 2014 10:25:18 +0100
Parents: 178dd8381453fb8a4394a724745ffc43cd128018 0581e877a500a77e31a991ee56fd92a0c93ed4cb
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bcd9c6b25657ee8dfcf7a8975651742ea8a1f280
Log:
Merge branch 'PHP-5.6'
* PHP-5.6:
added test for things done so far for bug #66265
partially fixed bug #66265
forked bug67052.phpt for Windows
Bugs:
https://bugs.php.net/66265
https://bugs.php.net/67052
Changed paths:
MM ext/standard/basic_functions.c
Diff:
diff --cc ext/standard/basic_functions.c
index a168069,694ce5b..f6b9f93
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@@ -4114,16 -4108,20 +4114,20 @@@ PHP_FUNCTION(putenv
if (putenv(pe.putenv_string) == 0) { /* success */
# else
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
+
+ if (error_code != 0
+ # ifndef ZTS
+ /* We need both SetEnvironmentVariable and _putenv here as some
+ dependency lib could use either way to read the environment.
+ Obviously the CRT version will be useful more often. But
+ generally, doing both brings us on the safe track at least
+ in NTS build. */
+ && _putenv(pe.putenv_string) == 0
+ # endif
+ ) { /* success */
# endif
#endif
- zend_hash_add(&BG(putenv_ht), pe.key, pe.key_len + 1, (void **) &pe,
sizeof(putenv_entry), NULL);
+ zend_hash_str_add_mem(&BG(putenv_ht), pe.key, pe.key_len, &pe, sizeof(putenv_entry));
#ifdef HAVE_TZSET
if (!strncmp(pe.key, "TZ", pe.key_len)) {
tzset();