Commit:    d7da1aa694a9a29ca7ec772e5d51d96b6dc8dda0
Author:    Lars Strojny <lstro...@php.net>         Sun, 6 Jan 2013 14:08:23 
+0100
Parents:   a426e0b05074621643c44b67ed2d0d8674721bf5
Branches:  master

Link:       
http://git.php.net/?p=php-src.git;a=commitdiff;h=d7da1aa694a9a29ca7ec772e5d51d96b6dc8dda0

Log:
Coding style, ANSI C compatibility

Changed paths:
  M  ext/date/php_date.c


Diff:
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 1837f94..765b0bf 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -847,7 +847,7 @@ timelib_tzinfo *php_date_parse_tzfile_wrapper(char 
*formal_tzname, const timelib
 }
 /* }}} */
 
-// created this callback method to check the date.timezone only when changed, 
to increase performance and error on an ini_set line
+/* Callback to check the date.timezone only when changed increases performance 
*/
 /* {{{ static PHP_INI_MH(OnUpdate_date_timezone) */
 static PHP_INI_MH(OnUpdate_date_timezone)
 {
@@ -872,7 +872,7 @@ static PHP_INI_MH(OnUpdate_date_timezone)
 static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC)
 {
        /* Checking configure timezone */
-       if (DATEG(timezone) && strlen(DATEG(timezone)) > 0) {
+       if (DATEG(timezone) && (strlen(DATEG(timezone))) > 0) {
                return DATEG(timezone);
        }
        /* Check config setting for default timezone */
@@ -880,11 +880,12 @@ static char* guess_timezone(const timelib_tzdb *tzdb 
TSRMLS_DC)
                /* Special case: ext/date wasn't initialized yet */
                zval ztz;
 
-               if (SUCCESS == 
zend_get_configuration_directive("date.timezone", sizeof("date.timezone"), 
&ztz) && Z_TYPE(ztz) == IS_STRING && Z_STRLEN(ztz) > 0 && 
timelib_timezone_id_is_valid(Z_STRVAL(ztz), tzdb)) {
+               if (SUCCESS == 
zend_get_configuration_directive("date.timezone", sizeof("date.timezone"), &ztz)
+                       && Z_TYPE(ztz) == IS_STRING && Z_STRLEN(ztz) > 0 && 
timelib_timezone_id_is_valid(Z_STRVAL(ztz), tzdb)) {
                        return Z_STRVAL(ztz);
                }
        } else if (*DATEG(default_timezone)) {
-               if (DATEG(timezone_valid) == 1) { // timezone already checked 
and validated
+               if (DATEG(timezone_valid) == 1) {
                        return DATEG(default_timezone);
                }


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to