]> granicus.if.org Git - php/commitdiff
- MFB: Fixed bug #40290 (strtotime() returns unexpected result with particular
authorDerick Rethans <derick@php.net>
Fri, 13 Apr 2007 08:11:35 +0000 (08:11 +0000)
committerDerick Rethans <derick@php.net>
Fri, 13 Apr 2007 08:11:35 +0000 (08:11 +0000)
  timezone offset).

ext/date/lib/parse_date.c
ext/date/lib/parse_date.re

index d5cd30b80f20acdd66ba7902ddb5393e0006fd8c..1eddeb0486bb2a70c2a7bea5dd67813d05c3d458 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.11.0 on Wed Apr 11 16:36:16 2007 */
+/* Generated by re2c 0.11.0 on Fri Apr 13 10:06:30 2007 */
 #line 1 "ext/date/lib/parse_date.re"
 /*
    +----------------------------------------------------------------------+
@@ -21774,7 +21774,8 @@ timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container
                } else {
                        timelib_error_container_dtor(in.errors);
                }
-               in.time->y = in.time->d = in.time->m = in.time->h = in.time->i = in.time->s = in.time->f = in.time->z = in.time->dst = -1;
+               in.time->y = in.time->d = in.time->m = in.time->h = in.time->i = in.time->s = in.time->f = in.time->dst = -1;
+               in.time->z = -999999;
                in.time->is_localtime = in.time->zone_type = 0;
                return in.time;
        }
@@ -21793,7 +21794,7 @@ timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container
        in.time->i = -1;
        in.time->s = -1;
        in.time->f = -1;
-       in.time->z = -1;
+       in.time->z = -999999;
        in.time->dst = -1;
        in.tzdb = tzdb;
        in.time->is_localtime = 0;
@@ -21830,7 +21831,7 @@ void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options)
        if (parsed->i == -1) parsed->i = now->i != -1 ? now->i : 0;
        if (parsed->s == -1) parsed->s = now->s != -1 ? now->s : 0;
        if (parsed->f == -1) parsed->f = now->f != -1 ? now->f : 0;
-       if (parsed->z == -1) parsed->z = now->z != -1 ? now->z : 0;
+       if (parsed->z == -999999) parsed->z = now->z != -999999 ? now->z : 0;
        if (parsed->dst == -1) parsed->dst = now->dst != -1 ? now->dst : 0;
 
        if (!parsed->tz_abbr) {
index 1f6d7aeb6241f6e9f847566ea8e643c6b49b3f7c..20e72ef922da489f0f5258bb50b0c34b56534265 100644 (file)
@@ -1543,7 +1543,8 @@ timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container
                } else {
                        timelib_error_container_dtor(in.errors);
                }
-               in.time->y = in.time->d = in.time->m = in.time->h = in.time->i = in.time->s = in.time->f = in.time->z = in.time->dst = -1;
+               in.time->y = in.time->d = in.time->m = in.time->h = in.time->i = in.time->s = in.time->f = in.time->dst = -1;
+               in.time->z = -999999;
                in.time->is_localtime = in.time->zone_type = 0;
                return in.time;
        }
@@ -1562,7 +1563,7 @@ timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container
        in.time->i = -1;
        in.time->s = -1;
        in.time->f = -1;
-       in.time->z = -1;
+       in.time->z = -999999;
        in.time->dst = -1;
        in.tzdb = tzdb;
        in.time->is_localtime = 0;
@@ -1599,7 +1600,7 @@ void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options)
        if (parsed->i == -1) parsed->i = now->i != -1 ? now->i : 0;
        if (parsed->s == -1) parsed->s = now->s != -1 ? now->s : 0;
        if (parsed->f == -1) parsed->f = now->f != -1 ? now->f : 0;
-       if (parsed->z == -1) parsed->z = now->z != -1 ? now->z : 0;
+       if (parsed->z == -999999) parsed->z = now->z != -999999 ? now->z : 0;
        if (parsed->dst == -1) parsed->dst = now->dst != -1 ? now->dst : 0;
 
        if (!parsed->tz_abbr) {