]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-5.6'
authorAnatol Belski <ab@php.net>
Fri, 21 Nov 2014 09:25:18 +0000 (10:25 +0100)
committerAnatol Belski <ab@php.net>
Fri, 21 Nov 2014 09:25:18 +0000 (10:25 +0100)
* PHP-5.6:
  added test for things done so far for bug #66265
  partially fixed bug #66265
  forked bug67052.phpt for Windows

1  2 
ext/standard/basic_functions.c

index a168069cfb623c1fe9a39af60ca72f71123f3812,694ce5be27f67a785e005f5ab4ba346b3e23ad18..f6b9f93fba655fa96d73fd475b20bb8b9e552d98
@@@ -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();