]> granicus.if.org Git - php/commitdiff
If TZ environment variable is changed call tzset().
authorfoobar <sniper@php.net>
Tue, 9 Jan 2001 09:02:21 +0000 (09:02 +0000)
committerfoobar <sniper@php.net>
Tue, 9 Jan 2001 09:02:21 +0000 (09:02 +0000)
# Although man page for tzset() says it should be called automaticly
# by some of the time related functions, IRL this doesn't happen.
# PR: 3977, 4732, 5510, 6972, 7203, 8502, 8609

ext/standard/basic_functions.c

index a59ed605f7e099c8a536adc28dff305f7347e991..90f425b958e0077b59c43cba624de11c7a8a01a1 100644 (file)
@@ -1059,6 +1059,9 @@ PHP_FUNCTION(putenv)
 
                if ((ret=putenv(pe.putenv_string))==0) { /* success */
                        zend_hash_add(&BG(putenv_ht),pe.key,pe.key_len+1,(void **) &pe,sizeof(putenv_entry),NULL);
+#ifdef HAVE_TZSET
+                       if(!strncmp(pe.key,"TZ",2)) tzset();
+#endif
                        RETURN_TRUE;
                } else {
                        efree(pe.putenv_string);