[PHP-CVS] cvs: php-src /ext/date/lib parse_date.c parse_date.re /ext/date/tests date-parse-by-format001.phpt
derick Wed Nov 5 10:41:48 2008 UTC Added files: /php-src/ext/date/tests date-parse-by-format001.phpt Modified files: /php-src/ext/date/lib parse_date.c parse_date.re Log: - Fixed an issue with the * format specifier for parsing from a user-defined format. http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.c?r1=1.99&r2=1.100&diff_format=u Index: php-src/ext/date/lib/parse_date.c diff -u php-src/ext/date/lib/parse_date.c:1.99 php-src/ext/date/lib/parse_date.c:1.100 --- php-src/ext/date/lib/parse_date.c:1.99 Fri Aug 29 11:59:22 2008 +++ php-src/ext/date/lib/parse_date.c Wed Nov 5 10:41:48 2008 @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Fri Aug 29 13:57:48 2008 */ +/* Generated by re2c 0.13.5 on Wed Nov 5 11:39:34 2008 */ #line 1 "ext/date/lib/parse_date.re" /* +--+ @@ -18,7 +18,7 @@ +--+ */ -/* $Id: parse_date.c,v 1.99 2008/08/29 11:59:22 derick Exp $ */ +/* $Id: parse_date.c,v 1.100 2008/11/05 10:41:48 derick Exp $ */ #include "timelib.h" @@ -626,6 +626,7 @@ static void timelib_eat_until_separator(char **ptr) { + ++*ptr; while (strchr(" \t.,:;/-0123456789", **ptr) == NULL) { ++*ptr; } @@ -838,11 +839,11 @@ std: s->tok = cursor; s->len = 0; -#line 964 "ext/date/lib/parse_date.re" +#line 965 "ext/date/lib/parse_date.re" -#line 846 "ext/date/lib/parse_date.c" +#line 847 "ext/date/lib/parse_date.c" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -982,7 +983,7 @@ } yy3: YYDEBUG(3, *YYCURSOR); -#line 1631 "ext/date/lib/parse_date.re" +#line 1632 "ext/date/lib/parse_date.re" { int tz_not_found; DEBUG_OUTPUT("tzcorrection | tz"); @@ -995,7 +996,7 @@ TIMELIB_DEINIT; return TIMELIB_TIMEZONE; } -#line 999 "ext/date/lib/parse_date.c" +#line 1000 "ext/date/lib/parse_date.c" yy4: YYDEBUG(4, *YYCURSOR); yych = *++YYCURSOR; @@ -1306,12 +1307,12 @@ if (yych <= '9') goto yy1383; yy12: YYDEBUG(12, *YYCURSOR); -#line 1726 "ext/date/lib/parse_date.re" +#line 1727 "ext/date/lib/parse_date.re" { add_error(s, "Unexpected character"); goto std; } -#line 1315 "ext/date/lib/parse_date.c" +#line 1316 "ext/date/lib/parse_date.c" yy13: YYDEBUG(13, *YYCURSOR); yych = *++YYCURSOR; @@ -2368,11 +2369,11 @@ if (yych <= '9') goto yy54; yy49: YYDEBUG(49, *YYCURSOR); -#line 1715 "ext/date/lib/parse_date.re" +#line 1716 "ext/date/lib/parse_date.re" { goto std; } -#line 2376 "ext/date/lib/parse_date.c" +#line 2377 "ext/date/lib/parse_date.c" yy50: YYDEBUG(50, *YYCURSOR); yych = *++YYCURSOR; @@ -2381,12 +2382,12 @@ YYDEBUG(51, *YYCURSOR); ++YYCURSOR; YYDEBUG(52, *YYCURSOR); -#line 1720 "ext/date/lib/parse_date.re" +#line 1721 "ext/date/lib/parse_date.re" { s->pos = cursor; s->line++; goto std; } -#line 2390 "ext/date/lib/parse_date.c" +#line 2391 "ext/date/lib/parse_date.c" yy53: YYDEBUG(53, *YYCURSOR); yych = *++YYCURSOR; @@ -2777,7 +2778,7 @@ if (yych == 's') goto yy73; yy72: YYDEBUG(72, *YYCURSOR); -#line 1699 "ext/date/lib/parse_date.re" +#line 1700 "ext/date/lib/parse_date.re" { timelib_ull i; DEBUG_OUTPUT("relative"); @@ -2792,7 +2793,7 @@ TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 2796 "ext/date/lib/parse_date.c" +#line 2797 "ext/date/lib/parse_date.c" yy73: YYDEBUG(73, *YYCURSOR); yych = *++YYCURSOR; @@ -3545,7 +3546,7 @@ } yy167: YYDEBUG(167, *YYCURSOR); -#line 1562 "ext/date/lib/parse_date.re" +#line 1563 "ext/date/lib/parse_date.re" { const timelib_relunit* relunit; DEBUG_OUTPUT("daytext"); @@ -3562,7 +3563,7 @@ TIMELIB_DEINIT; return TIMELIB_WEEKDAY; } -#line 3566 "ext/date/lib/parse_date.c" +#line 3567 "ext/date/lib/parse_date.c" yy168: YYDEBUG(168, *YYCURSOR); yych = *++YYCURSOR; @@ -4039,7 +4040,7 @@ } yy194: YYDEBUG(194, *YYCURSOR); -#line 1621 "ext/date/lib/parse_date.re" +#line 1622 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("monthtext"); TIMELIB_INIT; @@ -4048,7 +4049,7 @@ TIMELIB_DEINIT; return TIMELIB_DATE_TEXT; } -#line 4052 "ext/date/lib/parse_date.c" +#line 4053 "ext/date/lib/parse_date.c" yy195: YYDEBUG(195, *YYCURSOR); ++YYCURSOR; @@ -4099,7 +4100,7 @@ } yy199: YYDEBUG(199, *YYCURSOR)
[PHP-CVS] cvs: php-src /ext/date/lib parse_date.c parse_date.re /ext/date/tests bug43452.phpt
derick Wed Jul 23 18:49:38 2008 UTC Added files: /php-src/ext/date/tests bug43452.phpt Modified files: /php-src/ext/date/lib parse_date.re parse_date.c Log: - Fixed bug #43452 (strings containing a weekday, or a number plus weekday behaved incorrect of the current day-of-week was the same as the one in the phrase). (Derick) http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.re?r1=1.86&r2=1.87&diff_format=u Index: php-src/ext/date/lib/parse_date.re diff -u php-src/ext/date/lib/parse_date.re:1.86 php-src/ext/date/lib/parse_date.re:1.87 --- php-src/ext/date/lib/parse_date.re:1.86 Wed Jul 16 15:40:01 2008 +++ php-src/ext/date/lib/parse_date.re Wed Jul 23 18:49:37 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: parse_date.re,v 1.86 2008/07/16 15:40:01 derick Exp $ */ +/* $Id: parse_date.re,v 1.87 2008/07/23 18:49:37 derick Exp $ */ #include "timelib.h" @@ -1680,7 +1680,7 @@ while(*ptr) { i = timelib_get_unsigned_nr((char **) &ptr, 24); timelib_eat_spaces((char **) &ptr); - timelib_set_relative((char **) &ptr, i, 0, s); + timelib_set_relative((char **) &ptr, i, 1, s); } TIMELIB_DEINIT; return TIMELIB_RELATIVE; http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.c?r1=1.95&r2=1.96&diff_format=u Index: php-src/ext/date/lib/parse_date.c diff -u php-src/ext/date/lib/parse_date.c:1.95 php-src/ext/date/lib/parse_date.c:1.96 --- php-src/ext/date/lib/parse_date.c:1.95 Wed Jul 16 15:40:00 2008 +++ php-src/ext/date/lib/parse_date.c Wed Jul 23 18:49:37 2008 @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Wed Jul 16 17:39:20 2008 */ +/* Generated by re2c 0.13.5 on Wed Jul 23 20:47:26 2008 */ #line 1 "ext/date/lib/parse_date.re" /* +--+ @@ -18,7 +18,7 @@ +--+ */ -/* $Id: parse_date.c,v 1.95 2008/07/16 15:40:00 derick Exp $ */ +/* $Id: parse_date.c,v 1.96 2008/07/23 18:49:37 derick Exp $ */ #include "timelib.h" @@ -2749,7 +2749,7 @@ while(*ptr) { i = timelib_get_unsigned_nr((char **) &ptr, 24); timelib_eat_spaces((char **) &ptr); - timelib_set_relative((char **) &ptr, i, 0, s); + timelib_set_relative((char **) &ptr, i, 1, s); } TIMELIB_DEINIT; return TIMELIB_RELATIVE; http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug43452.phpt?view=markup&rev=1.1 Index: php-src/ext/date/tests/bug43452.phpt +++ php-src/ext/date/tests/bug43452.phpt --TEST-- Bug #43452 ("weekday" is not equivalent to "1 weekday" of the current weekday is "weekday") --INI-- date.default_timezone=Europe/Oslo --FILE-- is equivalent to 1 and will *not* forward if the current day // (November 1st) is the same day of week. $day = strtotime( "Thursday Nov 2007" ); echo date( DateTime::ISO8601, $day ), "\n"; $day = strtotime( "1 Thursday Nov 2007" ); echo date( DateTime::ISO8601, $day ), "\n"; $day = strtotime( "2 Thursday Nov 2007" ); echo date( DateTime::ISO8601, $day ), "\n"; $day = strtotime( "3 Thursday Nov 2007" ); echo date( DateTime::ISO8601, $day ), "\n\n"; // forward one week, then behaves like above for week days $day = strtotime( "Thursday Nov 2007" ); echo date( DateTime::ISO8601, $day ), "\n"; $day = strtotime( "+1 week Thursday Nov 2007" ); echo date( DateTime::ISO8601, $day ), "\n"; $day = strtotime( "+2 week Thursday Nov 2007" ); echo date( DateTime::ISO8601, $day ), "\n"; $day = strtotime( "+3 week Thursday Nov 2007" ); echo date( DateTime::ISO8601, $day ), "\n\n"; // First, second, etc skip to the first/second weekday *after* the current day. // This makes "first thursday" equivalent to "+1 week thursday" - but only // if the current day-of-week is the one mentioned in the phrase. $day = strtotime( "Thursday Nov 2007" ); echo date( DateTime::ISO8601, $day ), "\n"; $day = strtotime( "first Thursday Nov 2007" ); echo date( DateTime::ISO8601, $day ), "\n"; $day = strtotime( "second Thursday Nov 2007" ); echo date( DateTime::ISO8601, $day ), "\n"; $day = strtotime( "third Thursday Nov 2007" ); echo date( DateTime::ISO8601, $day ), "\n\n"; // Now the same where the current day-of-week does not match the one in the // phrase. $day = strtotime( "Friday Nov 2007" ); echo date( DateTime::ISO8601, $day ), "\n"; $day = strtotime( "first Friday Nov 2007" ); echo date( DateTime::ISO8601, $day ), "\n"; $day = strtotime( "second Friday Nov 2007" ); echo date( DateTime::ISO8601, $day ), "\n"; $day = strtotime( "third Friday Nov 2007" ); echo date( DateTime::ISO8601, $day ), "\n\n"; ?> --EXPECT-- 2007-11-01T
[PHP-CVS] cvs: php-src /ext/date/lib parse_date.c parse_date.re
derick Wed Jul 16 15:40:01 2008 UTC Modified files: /php-src/ext/date/lib parse_date.c parse_date.re Log: - Fixed bug #45529 (new DateTimeZone() and date_create()->getTimezone() behave different). http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.c?r1=1.94&r2=1.95&diff_format=u Index: php-src/ext/date/lib/parse_date.c diff -u php-src/ext/date/lib/parse_date.c:1.94 php-src/ext/date/lib/parse_date.c:1.95 --- php-src/ext/date/lib/parse_date.c:1.94 Tue Jul 15 17:37:32 2008 +++ php-src/ext/date/lib/parse_date.c Wed Jul 16 15:40:00 2008 @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Tue Jul 15 19:35:53 2008 */ +/* Generated by re2c 0.13.5 on Wed Jul 16 17:39:20 2008 */ #line 1 "ext/date/lib/parse_date.re" /* +--+ @@ -18,7 +18,7 @@ +--+ */ -/* $Id: parse_date.c,v 1.94 2008/07/15 17:37:32 derick Exp $ */ +/* $Id: parse_date.c,v 1.95 2008/07/16 15:40:00 derick Exp $ */ #include "timelib.h" @@ -800,7 +800,7 @@ } #endif /* If we have a TimeZone identifier to start with, use it */ - if (strstr(tz_abbr, "/")) { + if (strstr(tz_abbr, "/") || strcmp(tz_abbr, "UTC") == 0) { if ((res = timelib_parse_tzfile(tz_abbr, tzdb)) != NULL) { t->tz_info = res; t->zone_type = TIMELIB_ZONETYPE_ID; http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.re?r1=1.85&r2=1.86&diff_format=u Index: php-src/ext/date/lib/parse_date.re diff -u php-src/ext/date/lib/parse_date.re:1.85 php-src/ext/date/lib/parse_date.re:1.86 --- php-src/ext/date/lib/parse_date.re:1.85 Tue Jul 15 17:37:33 2008 +++ php-src/ext/date/lib/parse_date.re Wed Jul 16 15:40:01 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: parse_date.re,v 1.85 2008/07/15 17:37:33 derick Exp $ */ +/* $Id: parse_date.re,v 1.86 2008/07/16 15:40:01 derick Exp $ */ #include "timelib.h" @@ -798,7 +798,7 @@ } #endif /* If we have a TimeZone identifier to start with, use it */ - if (strstr(tz_abbr, "/")) { + if (strstr(tz_abbr, "/") || strcmp(tz_abbr, "UTC") == 0) { if ((res = timelib_parse_tzfile(tz_abbr, tzdb)) != NULL) { t->tz_info = res; t->zone_type = TIMELIB_ZONETYPE_ID; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/date/lib parse_date.c parse_date.re
derick Fri Jul 11 08:42:11 2008 UTC Modified files: /php-src/ext/date/lib parse_date.c parse_date.re Log: - Fixed a compiler warning - the code didn't make much sense. http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.c?r1=1.91&r2=1.92&diff_format=u Index: php-src/ext/date/lib/parse_date.c diff -u php-src/ext/date/lib/parse_date.c:1.91 php-src/ext/date/lib/parse_date.c:1.92 --- php-src/ext/date/lib/parse_date.c:1.91 Tue Jul 8 20:23:38 2008 +++ php-src/ext/date/lib/parse_date.c Fri Jul 11 08:42:10 2008 @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Tue Jul 8 22:21:57 2008 */ +/* Generated by re2c 0.13.5 on Fri Jul 11 10:41:19 2008 */ #line 1 "ext/date/lib/parse_date.re" /* +--+ @@ -18,7 +18,7 @@ +--+ */ -/* $Id: parse_date.c,v 1.91 2008/07/08 20:23:38 derick Exp $ */ +/* $Id: parse_date.c,v 1.92 2008/07/11 08:42:10 derick Exp $ */ #include "timelib.h" @@ -23410,11 +23410,8 @@ switch (*fptr) { case 'D': /* three letter day */ case 'l': /* full day */ - tmp = timelib_lookup_relunit((char **) &ptr); - if (!tmp) { + if (!timelib_lookup_relunit((char **) &ptr)) { add_pbf_error(s, "A textual day could not be found", string, begin); - } else { - s->time->m = tmp; } break; case 'd': /* two digit day, with leading zero */ http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.re?r1=1.82&r2=1.83&diff_format=u Index: php-src/ext/date/lib/parse_date.re diff -u php-src/ext/date/lib/parse_date.re:1.82 php-src/ext/date/lib/parse_date.re:1.83 --- php-src/ext/date/lib/parse_date.re:1.82 Tue Jul 8 20:23:38 2008 +++ php-src/ext/date/lib/parse_date.re Fri Jul 11 08:42:11 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: parse_date.re,v 1.82 2008/07/08 20:23:38 derick Exp $ */ +/* $Id: parse_date.re,v 1.83 2008/07/11 08:42:11 derick Exp $ */ #include "timelib.h" @@ -1820,11 +1820,8 @@ switch (*fptr) { case 'D': /* three letter day */ case 'l': /* full day */ - tmp = timelib_lookup_relunit((char **) &ptr); - if (!tmp) { + if (!timelib_lookup_relunit((char **) &ptr)) { add_pbf_error(s, "A textual day could not be found", string, begin); - } else { - s->time->m = tmp; } break; case 'd': /* two digit day, with leading zero */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/date/lib parse_date.c parse_date.re /ext/date/tests test-parse-from-format.phpt
derick Tue Jul 8 20:23:39 2008 UTC Added files: /php-src/ext/date/tests test-parse-from-format.phpt Modified files: /php-src/ext/date/lib parse_date.c parse_date.re Log: - Fixed bug #45459 (date_create_from_format() fails on DATE_RFC3339) by allowing a few more format specifiers in date_create_from_format() / date_parse_from_format(). http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.c?r1=1.90&r2=1.91&diff_format=u Index: php-src/ext/date/lib/parse_date.c diff -u php-src/ext/date/lib/parse_date.c:1.90 php-src/ext/date/lib/parse_date.c:1.91 --- php-src/ext/date/lib/parse_date.c:1.90 Tue Jul 8 18:27:06 2008 +++ php-src/ext/date/lib/parse_date.c Tue Jul 8 20:23:38 2008 @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.4 on Tue Jul 8 20:26:31 2008 */ +/* Generated by re2c 0.13.5 on Tue Jul 8 22:21:57 2008 */ #line 1 "ext/date/lib/parse_date.re" /* +--+ @@ -18,7 +18,7 @@ +--+ */ -/* $Id: parse_date.c,v 1.90 2008/07/08 18:27:06 derick Exp $ */ +/* $Id: parse_date.c,v 1.91 2008/07/08 20:23:38 derick Exp $ */ #include "timelib.h" @@ -637,7 +637,7 @@ char *begin = *ptr, *end; const timelib_relunit *tp, *value = NULL; - while (**ptr != '\0' && **ptr != ' ' && **ptr != '\t') { + while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t') { ++*ptr; } end = *ptr; @@ -23408,6 +23408,15 @@ while (*fptr && *ptr) { begin = ptr; switch (*fptr) { + case 'D': /* three letter day */ + case 'l': /* full day */ + tmp = timelib_lookup_relunit((char **) &ptr); + if (!tmp) { + add_pbf_error(s, "A textual day could not be found", string, begin); + } else { + s->time->m = tmp; + } + break; case 'd': /* two digit day, with leading zero */ case 'j': /* two digit day, without leading zero */ TIMELIB_CHECK_NUMBER; @@ -23521,6 +23530,9 @@ break; case 'e': /* timezone */ + case 'P': /* timezone */ + case 'T': /* timezone */ + case 'O': /* timezone */ { int tz_not_found; s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); @@ -23575,6 +23587,15 @@ ++ptr; break; + case '\\': /* escaped char */ + *fptr++; + if (*ptr == *fptr) { + ++ptr; + } else { + add_pbf_error(s, "The escaped character could not be found", string, begin); + } + break; + case '*': /* random chars until a separator or number ([ \t.,:;/-0123456789]) */ timelib_eat_until_separator((char **) &ptr); break; http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.re?r1=1.81&r2=1.82&diff_format=u Index: php-src/ext/date/lib/parse_date.re diff -u php-src/ext/date/lib/parse_date.re:1.81 php-src/ext/date/lib/parse_date.re:1.82 --- php-src/ext/date/lib/parse_date.re:1.81 Tue Jul 8 18:27:07 2008 +++ php-src/ext/date/lib/parse_date.re Tue Jul 8 20:23:38 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: parse_date.re,v 1.81 2008/07/08 18:27:07 derick Exp $ */ +/* $Id: parse_date.re,v 1.82 2008/07/08 20:23:38 derick Exp $ */ #include "timelib.h" @@ -635,7 +635,7 @@ char *begin = *ptr, *end; const timelib_relunit *tp, *value = NULL; - while (**ptr != '\0' && **ptr != ' ' && **ptr != '\t') { + while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t') { ++*ptr; } end = *ptr; @@ -1818,6 +1818,15 @@ while (*fptr && *ptr) { begin = ptr; switch (*fptr) { + case 'D': /* three letter day */ + case 'l': /* full day */ + tmp = timelib_lookup_relunit((char **) &ptr); + if (!tmp) { + add_pb
[PHP-CVS] cvs: php-src /ext/date/lib parse_date.c parse_date.re
derick Mon Feb 25 18:25:01 2008 UTC Modified files: /php-src/ext/date/lib parse_date.c parse_date.re Log: - Added a few new separation specifiers. - Added specifiers that can reset or default the y/m/d/h/i/s/tz values. - Fixed a problem with parsing timezones as part of a format. #- [DOC]: Added format specifiers. http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.c?r1=1.81&r2=1.82&diff_format=u Index: php-src/ext/date/lib/parse_date.c diff -u php-src/ext/date/lib/parse_date.c:1.81 php-src/ext/date/lib/parse_date.c:1.82 --- php-src/ext/date/lib/parse_date.c:1.81 Sun Feb 17 18:17:00 2008 +++ php-src/ext/date/lib/parse_date.c Mon Feb 25 18:25:00 2008 @@ -1,4 +1,4 @@ -/* Generated by re2c 0.12.1 on Sun Feb 17 19:16:04 2008 */ +/* Generated by re2c 0.12.1 on Mon Feb 25 19:12:37 2008 */ #line 1 "ext/date/lib/parse_date.re" /* +--+ @@ -18,7 +18,7 @@ +--+ */ -/* $Id: parse_date.c,v 1.81 2008/02/17 18:17:00 derick Exp $ */ +/* $Id: parse_date.c,v 1.82 2008/02/25 18:25:00 derick Exp $ */ #include "timelib.h" @@ -728,7 +728,7 @@ long value = 0; const timelib_tz_lookup_table *tp; - while (**ptr != '\0' && **ptr != ')') { + while (**ptr != '\0' && **ptr != ')' && **ptr != ' ') { ++*ptr; } end = *ptr; @@ -23095,6 +23095,39 @@ } break; + case ';': + case ':': + case '/': + case '.': + case ',': + case '-': + if (*ptr == *fptr) { + ++ptr; + } else { + add_pbf_error(s, "The separation symbol could not be found", string, begin); + } + break; + + case '!': // reset all fields to default + s->time->y = 1970; + s->time->m = 1; + s->time->d = 1; + s->time->h = s->time->i = s->time->s = 0; + s->time->f = 0.0; + s->time->tz_info = NULL; + break; // break intentionally not missing + + case '|': // reset all fields to default when not set + if (s->time->y == TIMELIB_UNSET ) s->time->y = 1970; + if (s->time->m == TIMELIB_UNSET ) s->time->m = 1; + if (s->time->d == TIMELIB_UNSET ) s->time->d = 1; + if (s->time->h == TIMELIB_UNSET ) s->time->h = 0; + if (s->time->i == TIMELIB_UNSET ) s->time->i = 0; + if (s->time->s == TIMELIB_UNSET ) s->time->s = 0; + if (s->time->f == TIMELIB_UNSET ) s->time->f = 0.0; + + break; // break intentionally not missing + case '?': // random char ++ptr; break; @@ -23118,6 +23151,20 @@ add_pbf_error(s, "Data missing", string, ptr); } + // clean up a bit + if (s->time->h != TIMELIB_UNSET || s->time->i != TIMELIB_UNSET || s->time->s != TIMELIB_UNSET) { + if (s->time->h == TIMELIB_UNSET ) { + s->time->h = 0; + } + if (s->time->i == TIMELIB_UNSET ) { + s->time->i = 0; + } + if (s->time->s == TIMELIB_UNSET ) { + s->time->s = 0; + } + } + + if (errors) { *errors = in.errors; } else { http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.re?r1=1.72&r2=1.73&diff_format=u Index: php-src/ext/date/lib/parse_date.re diff -u php-src/ext/date/lib/parse_date.re:1.72 php-src/ext/date/lib/parse_date.re:1.73 --- php-src/ext/date/lib/parse_date.re:1.72 Sun Feb 17 18:17:01 2008 +++ php-src/ext/date/lib/parse_date.re Mon Feb 25 18:25:01 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: parse_date.re,v 1.72 2008/02/17 18:17:01 derick Exp $ */ +/* $Id: parse_date.re,v 1.73 2008/02/25 18:25:01 derick Exp $ */ #include "timelib.h" @@ -726,7 +726,7 @@ long value = 0; const timelib_tz_lookup_table *tp; - while (**ptr != '\0' && **ptr != ')') { + while (**ptr != '\0' && **ptr != ')' && **ptr != ' ') {
[PHP-CVS] cvs: php-src /ext/date/lib parse_date.c parse_date.re
derick Sun Feb 17 18:17:01 2008 UTC Modified files: /php-src/ext/date/lib parse_date.c parse_date.re Log: - Fixed typoes. http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.c?r1=1.80&r2=1.81&diff_format=u Index: php-src/ext/date/lib/parse_date.c diff -u php-src/ext/date/lib/parse_date.c:1.80 php-src/ext/date/lib/parse_date.c:1.81 --- php-src/ext/date/lib/parse_date.c:1.80 Sun Feb 3 14:10:46 2008 +++ php-src/ext/date/lib/parse_date.c Sun Feb 17 18:17:00 2008 @@ -1,4 +1,4 @@ -/* Generated by re2c 0.12.1 on Sun Feb 3 15:07:12 2008 */ +/* Generated by re2c 0.12.1 on Sun Feb 17 19:16:04 2008 */ #line 1 "ext/date/lib/parse_date.re" /* +--+ @@ -18,7 +18,7 @@ +--+ */ -/* $Id: parse_date.c,v 1.80 2008/02/03 14:10:46 derick Exp $ */ +/* $Id: parse_date.c,v 1.81 2008/02/17 18:17:00 derick Exp $ */ #include "timelib.h" @@ -620,7 +620,7 @@ } } -static void timelib_eat_until_seperator(char **ptr) +static void timelib_eat_until_separator(char **ptr) { while (strchr(" \t.,:;/-0123456789", **ptr) == NULL) { ++*ptr; @@ -23036,7 +23036,7 @@ if (s->time->h == TIMELIB_UNSET) { add_pbf_error(s, "Meridian can only come after an hour has been found", string, begin); } else if ((tmp = timelib_meridian_with_check((char **) &ptr, s->time->h)) == TIMELIB_UNSET) { - add_pbf_error(s, "A meridian could no tbe found", string, begin); + add_pbf_error(s, "A meridian could not be found", string, begin); } else { s->time->h += tmp; } @@ -23091,7 +23091,7 @@ if (*ptr == ';' || *ptr == ':' || *ptr == '/' || *ptr == '.' || *ptr == ',' || *ptr == '-') { ++ptr; } else { - add_pbf_error(s, "The seperation symbol ([;:/.,-]) could not be found", string, begin); + add_pbf_error(s, "The separation symbol ([;:/.,-]) could not be found", string, begin); } break; @@ -23099,13 +23099,13 @@ ++ptr; break; - case '*': // random chars until a seperator or number ([ \t.,:;/-0123456789]) - timelib_eat_until_seperator((char **) &ptr); + case '*': // random chars until a separator or number ([ \t.,:;/-0123456789]) + timelib_eat_until_separator((char **) &ptr); break; default: if (*fptr != *ptr) { - add_pbf_error(s, "The format seperator does not match", string, begin); + add_pbf_error(s, "The format separator does not match", string, begin); } ptr++; } http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.re?r1=1.71&r2=1.72&diff_format=u Index: php-src/ext/date/lib/parse_date.re diff -u php-src/ext/date/lib/parse_date.re:1.71 php-src/ext/date/lib/parse_date.re:1.72 --- php-src/ext/date/lib/parse_date.re:1.71 Sun Feb 3 14:10:48 2008 +++ php-src/ext/date/lib/parse_date.re Sun Feb 17 18:17:01 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: parse_date.re,v 1.71 2008/02/03 14:10:48 derick Exp $ */ +/* $Id: parse_date.re,v 1.72 2008/02/17 18:17:01 derick Exp $ */ #include "timelib.h" @@ -618,7 +618,7 @@ } } -static void timelib_eat_until_seperator(char **ptr) +static void timelib_eat_until_separator(char **ptr) { while (strchr(" \t.,:;/-0123456789", **ptr) == NULL) { ++*ptr; @@ -1808,7 +1808,7 @@ if (s->time->h == TIMELIB_UNSET) { add_pbf_error(s, "Meridian can only come after an hour has been found", string, begin); } else if ((tmp = timelib_meridian_with_check((char **) &ptr, s->time->h)) == TIMELIB_UNSET) { - add_pbf_error(s, "A meridian could no tbe found", string, begin); + add_pbf_error(s, "A meridian could not be found", string, begin); } else { s->time->h += tmp; }
[PHP-CVS] cvs: php-src /ext/date/lib parse_date.c parse_date.re
derick Tue Jan 29 20:15:44 2008 UTC Modified files: /php-src/ext/date/lib parse_date.re parse_date.c Log: - MF53: That should have been ||. http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.re?r1=1.69&r2=1.70&diff_format=u Index: php-src/ext/date/lib/parse_date.re diff -u php-src/ext/date/lib/parse_date.re:1.69 php-src/ext/date/lib/parse_date.re:1.70 --- php-src/ext/date/lib/parse_date.re:1.69 Tue Jan 29 20:08:41 2008 +++ php-src/ext/date/lib/parse_date.re Tue Jan 29 20:15:44 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: parse_date.re,v 1.69 2008/01/29 20:08:41 derick Exp $ */ +/* $Id: parse_date.re,v 1.70 2008/01/29 20:15:44 derick Exp $ */ #include "timelib.h" @@ -755,7 +755,7 @@ while (**ptr == ' ' || **ptr == '\t' || **ptr == '(') { ++*ptr; } - if ((*ptr)[0] == 'G' && (*ptr)[1] == 'M' && (*ptr)[2] == 'T' && ((*ptr)[3] == '+' | (*ptr)[3] == '-')) { + if ((*ptr)[0] == 'G' && (*ptr)[1] == 'M' && (*ptr)[2] == 'T' && ((*ptr)[3] == '+' || (*ptr)[3] == '-')) { *ptr += 3; } if (**ptr == '+') { http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.c?r1=1.78&r2=1.79&diff_format=u Index: php-src/ext/date/lib/parse_date.c diff -u php-src/ext/date/lib/parse_date.c:1.78 php-src/ext/date/lib/parse_date.c:1.79 --- php-src/ext/date/lib/parse_date.c:1.78 Tue Jan 29 20:10:53 2008 +++ php-src/ext/date/lib/parse_date.c Tue Jan 29 20:15:44 2008 @@ -1,4 +1,4 @@ -/* Generated by re2c 0.12.1 on Tue Jan 29 21:07:53 2008 */ +/* Generated by re2c 0.12.1 on Tue Jan 29 21:14:49 2008 */ #line 1 "ext/date/lib/parse_date.re" /* +--+ @@ -18,7 +18,7 @@ +--+ */ -/* $Id: parse_date.c,v 1.78 2008/01/29 20:10:53 derick Exp $ */ +/* $Id: parse_date.c,v 1.79 2008/01/29 20:15:44 derick Exp $ */ #include "timelib.h" @@ -757,7 +757,7 @@ while (**ptr == ' ' || **ptr == '\t' || **ptr == '(') { ++*ptr; } - if ((*ptr)[0] == 'G' && (*ptr)[1] == 'M' && (*ptr)[2] == 'T' && ((*ptr)[3] == '+' | (*ptr)[3] == '-')) { + if ((*ptr)[0] == 'G' && (*ptr)[1] == 'M' && (*ptr)[2] == 'T' && ((*ptr)[3] == '+' || (*ptr)[3] == '-')) { *ptr += 3; } if (**ptr == '+') { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/date/lib parse_date.c parse_date.re /ext/date/tests date_create-2.phpt strtotime.phpt
derick Sun Jan 27 22:16:00 2008 UTC Modified files: /php-src/ext/date/lib parse_date.c parse_date.re /php-src/ext/date/tests date_create-2.phpt strtotime.phpt Log: - Fixed parsing of timestamps. http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.c?r1=1.76&r2=1.77&diff_format=u Index: php-src/ext/date/lib/parse_date.c diff -u php-src/ext/date/lib/parse_date.c:1.76 php-src/ext/date/lib/parse_date.c:1.77 --- php-src/ext/date/lib/parse_date.c:1.76 Thu Jan 17 20:43:58 2008 +++ php-src/ext/date/lib/parse_date.c Sun Jan 27 22:15:59 2008 @@ -1,4 +1,4 @@ -/* Generated by re2c 0.12.1 on Thu Jan 17 21:42:37 2008 */ +/* Generated by re2c 0.12.1 on Sun Jan 27 23:15:51 2008 */ #line 1 "ext/date/lib/parse_date.re" /* +--+ @@ -18,7 +18,7 @@ +--+ */ -/* $Id: parse_date.c,v 1.76 2008/01/17 20:43:58 derick Exp $ */ +/* $Id: parse_date.c,v 1.77 2008/01/27 22:15:59 derick Exp $ */ #include "timelib.h" @@ -975,7 +975,7 @@ } yy3: YYDEBUG(3, *YYCURSOR); -#line 1501 "ext/date/lib/parse_date.re" +#line 1502 "ext/date/lib/parse_date.re" { int tz_not_found; DEBUG_OUTPUT("tzcorrection | tz"); @@ -1299,7 +1299,7 @@ if(yych <= '9') goto yy1274; yy12: YYDEBUG(12, *YYCURSOR); -#line 1596 "ext/date/lib/parse_date.re" +#line 1597 "ext/date/lib/parse_date.re" { add_error(s, "Unexpected character"); goto std; @@ -2310,7 +2310,7 @@ if(yych <= '9') goto yy51; yy46: YYDEBUG(46, *YYCURSOR); -#line 1585 "ext/date/lib/parse_date.re" +#line 1586 "ext/date/lib/parse_date.re" { goto std; } @@ -2323,7 +2323,7 @@ YYDEBUG(48, *YYCURSOR); ++YYCURSOR; YYDEBUG(49, *YYCURSOR); -#line 1590 "ext/date/lib/parse_date.re" +#line 1591 "ext/date/lib/parse_date.re" { s->pos = cursor; s->line++; goto std; @@ -2707,7 +2707,7 @@ if(yych == 's') goto yy70; yy69: YYDEBUG(69, *YYCURSOR); -#line 1569 "ext/date/lib/parse_date.re" +#line 1570 "ext/date/lib/parse_date.re" { timelib_ull i; DEBUG_OUTPUT("relative"); @@ -3630,7 +3630,7 @@ if(yych == 's') goto yy175; yy174: YYDEBUG(174, *YYCURSOR); -#line 1474 "ext/date/lib/parse_date.re" +#line 1475 "ext/date/lib/parse_date.re" { timelib_sll i; int behavior = 0; @@ -4821,7 +4821,7 @@ } yy276: YYDEBUG(276, *YYCURSOR); -#line 1458 "ext/date/lib/parse_date.re" +#line 1459 "ext/date/lib/parse_date.re" { const timelib_relunit* relunit; DEBUG_OUTPUT("daytext"); @@ -5313,7 +5313,7 @@ } yy303: YYDEBUG(303, *YYCURSOR); -#line 1491 "ext/date/lib/parse_date.re" +#line 1492 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("monthtext"); TIMELIB_INIT; @@ -5373,7 +5373,7 @@ } yy308: YYDEBUG(308, *YYCURSOR); -#line 1270 "ext/date/lib/parse_date.re" +#line 1271 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("datetextual | datenoyear"); TIMELIB_INIT; @@ -5658,7 +5658,7 @@ } yy332: YYDEBUG(332, *YYCURSOR); -#line 1539 "ext/date/lib/parse_date.re" +#line 1540 "ext/date/lib/parse_date.re" { int tz_not_found; DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz"); @@ -6298,7 +6298,7 @@ YYDEBUG(385, *YYCURSOR); ++YYCURSOR; YYDEBUG(386, *YYCURSOR); -#line 1515 "ext/date/lib/parse_date.re" +#line 1516 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12"); TIMELIB_INIT; @@ -6497,7 +6497,7 @@ if(yych <= '9') goto yy397; yy402: YYDEBUG(402, *YYCURSOR); -#line 1244 "ext/date/lib/parse_date.re" +#line 1245 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("datenoday"); TIMELIB_INIT; @@ -7745,7 +7745,7 @@ if(yych <= '9') goto yy474; yy473: YYDEBUG(473, *YYCURSOR); -#line 1384 "ext/date/lib/parse_date.re" +#line 1385 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("pgtextshort"); TIMELIB_INIT; @@ -9638,7 +9638,7 @@ } yy558: YYDEBUG(558, *YYCURSOR); -#line 1440 "ext/date/lib/parse_
[PHP-CVS] cvs: php-src /ext/date/lib parse_date.c parse_date.re /ext/date/tests bug43075.phpt
derick Thu Jan 17 20:43:58 2008 UTC Added files: /php-src/ext/date/tests bug43075.phpt Modified files: /php-src/ext/date/lib parse_date.c parse_date.re Log: - Fixed bug #43075 (Support 2007-11-01T24:00:00+00:00). http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.c?r1=1.75&r2=1.76&diff_format=u Index: php-src/ext/date/lib/parse_date.c diff -u php-src/ext/date/lib/parse_date.c:1.75 php-src/ext/date/lib/parse_date.c:1.76 --- php-src/ext/date/lib/parse_date.c:1.75 Sun Jan 13 15:16:47 2008 +++ php-src/ext/date/lib/parse_date.c Thu Jan 17 20:43:58 2008 @@ -1,4 +1,4 @@ -/* Generated by re2c 0.12.1 on Sun Jan 13 15:57:11 2008 */ +/* Generated by re2c 0.12.1 on Thu Jan 17 21:42:37 2008 */ #line 1 "ext/date/lib/parse_date.re" /* +--+ @@ -18,7 +18,7 @@ +--+ */ -/* $Id: parse_date.c,v 1.75 2008/01/13 15:16:47 derick Exp $ */ +/* $Id: parse_date.c,v 1.76 2008/01/17 20:43:58 derick Exp $ */ #include "timelib.h" @@ -1451,8 +1451,8 @@ case '0': case '1': case '2': - case '3': goto yy1238; - case '4': + case '3': + case '4': goto yy1238; case '5': case '6': case '7': @@ -5548,7 +5548,7 @@ if(yych == '.') goto yy371; goto yy308; } else { - if(yych <= '3') goto yy403; + if(yych <= '4') goto yy403; if(yych <= '9') goto yy400; if(yych <= ':') goto yy371; goto yy308; @@ -5630,7 +5630,7 @@ if(yych == '.') goto yy330; goto yy53; } else { - if(yych <= '3') goto yy329; + if(yych <= '4') goto yy329; if(yych == ':') goto yy330; goto yy53; } @@ -6013,7 +6013,7 @@ yych = *++YYCURSOR; if(yych <= '5') { if(yych <= '/') goto yy332; - if(yych >= '4') goto yy365; + if(yych >= '5') goto yy365; } else { if(yych <= '9') goto yy337; if(yych <= ':') goto yy364; @@ -6073,7 +6073,7 @@ if(yych == '.') goto yy371; goto yy308; } else { - if(yych <= '3') goto yy398; + if(yych <= '4') goto yy398; if(yych <= '9') goto yy370; if(yych <= ':') goto yy371; goto yy308; @@ -6633,7 +6633,7 @@ if(yych == '.') goto yy371; goto yy308; } else { - if(yych <= '3') goto yy413; + if(yych <= '4') goto yy413; if(yych <= '9') goto yy412; if(yych <= ':') goto yy371; goto yy308; @@ -6714,7 +6714,7 @@ if(yych == '.') goto yy420; goto yy308; } else { - if(yych <= '3') goto yy434; + if(yych <= '4') goto yy434; if(yych <= '9') goto yy433; if(yych <= ':') goto yy420; goto yy308; @@ -7210,7 +7210,7 @@ if(yych == '.') goto yy447; goto yy308; } else { - if(yych <= '3') goto yy458; + if(yych <= '4') goto yy458; if(yych <= '9') goto yy457; if(yych <= ':') goto yy447; goto yy308; @@ -11893,7 +11893,7 @@ if(yych <= 0x1F) goto yy3; goto yy57; } else { - if(yych <= '3') { + if(yych <= '4') { if(yych <= '/') goto yy3; goto yy662; } else { @@ -15000,7 +15000,7 @@ YYDEBUG(874, *YYCURSOR); yych = *++YYCURSOR; if(yych <= '/') goto yy53; - if(yych >= '4') goto yy53; + if(yych >= '5') goto yy53; yy875: YYDEBUG(875, *YYCURSOR); yych = *++YYCURSOR; @@ -15095,7 +15095,7 @@ yych = *++YYCURSOR; if(yych <= '5') {
[PHP-CVS] cvs: php-src /ext/date/lib parse_date.c parse_date.re
derick Fri Apr 13 08:11:35 2007 UTC Modified files: /php-src/ext/date/lib parse_date.c parse_date.re Log: - MFB: Fixed bug #40290 (strtotime() returns unexpected result with particular timezone offset). http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.c?r1=1.72&r2=1.73&diff_format=u Index: php-src/ext/date/lib/parse_date.c diff -u php-src/ext/date/lib/parse_date.c:1.72 php-src/ext/date/lib/parse_date.c:1.73 --- php-src/ext/date/lib/parse_date.c:1.72 Wed Apr 11 14:36:44 2007 +++ php-src/ext/date/lib/parse_date.c Fri Apr 13 08:11:35 2007 @@ -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" /* +--+ @@ -18,7 +18,7 @@ +--+ */ -/* $Id: parse_date.c,v 1.72 2007/04/11 14:36:44 derick Exp $ */ +/* $Id: parse_date.c,v 1.73 2007/04/13 08:11:35 derick Exp $ */ #include "timelib.h" @@ -21774,7 +21774,8 @@ } 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 = -99; in.time->is_localtime = in.time->zone_type = 0; return in.time; } @@ -21793,7 +21794,7 @@ in.time->i = -1; in.time->s = -1; in.time->f = -1; - in.time->z = -1; + in.time->z = -99; in.time->dst = -1; in.tzdb = tzdb; in.time->is_localtime = 0; @@ -21830,7 +21831,7 @@ 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 == -99) parsed->z = now->z != -99 ? now->z : 0; if (parsed->dst == -1) parsed->dst = now->dst != -1 ? now->dst : 0; if (!parsed->tz_abbr) { http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.re?r1=1.63&r2=1.64&diff_format=u Index: php-src/ext/date/lib/parse_date.re diff -u php-src/ext/date/lib/parse_date.re:1.63 php-src/ext/date/lib/parse_date.re:1.64 --- php-src/ext/date/lib/parse_date.re:1.63 Wed Apr 11 14:36:45 2007 +++ php-src/ext/date/lib/parse_date.re Fri Apr 13 08:11:35 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: parse_date.re,v 1.63 2007/04/11 14:36:45 derick Exp $ */ +/* $Id: parse_date.re,v 1.64 2007/04/13 08:11:35 derick Exp $ */ #include "timelib.h" @@ -1543,7 +1543,8 @@ } 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 = -99; in.time->is_localtime = in.time->zone_type = 0; return in.time; } @@ -1562,7 +1563,7 @@ in.time->i = -1; in.time->s = -1; in.time->f = -1; - in.time->z = -1; + in.time->z = -99; in.time->dst = -1; in.tzdb = tzdb; in.time->is_localtime = 0; @@ -1599,7 +1600,7 @@ 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 == -99) parsed->z = now->z != -99 ? now->z : 0; if (parsed->dst == -1) parsed->dst = now->dst != -1 ? now->dst : 0; if (!parsed->tz_abbr) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/date/lib parse_date.c parse_date.re
derick Sat Sep 9 12:25:54 2006 UTC Modified files: /php-src/ext/date/lib parse_date.c parse_date.re Log: - The .c file is generated... so updating the .re file and cleaning up WS. http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.c?r1=1.68&r2=1.69&diff_format=u Index: php-src/ext/date/lib/parse_date.c diff -u php-src/ext/date/lib/parse_date.c:1.68 php-src/ext/date/lib/parse_date.c:1.69 --- php-src/ext/date/lib/parse_date.c:1.68 Fri Sep 8 20:22:23 2006 +++ php-src/ext/date/lib/parse_date.c Sat Sep 9 12:25:53 2006 @@ -1,4 +1,4 @@ -/* Generated by re2c 0.9.12 on Wed Sep 6 09:33:00 2006 */ +/* Generated by re2c 0.9.12 on Sat Sep 9 14:24:12 2006 */ #line 1 "ext/date/lib/parse_date.re" /* +--+ @@ -18,7 +18,7 @@ +--+ */ -/* $Id: parse_date.c,v 1.68 2006/09/08 20:22:23 tony2001 Exp $ */ +/* $Id: parse_date.c,v 1.69 2006/09/09 12:25:53 derick Exp $ */ #include "timelib.h" @@ -22147,8 +22147,8 @@ while (isspace(*e) && e > s) { e--; } - } - if (e - s < 1){ + } + if (e - s < 1) { in.time = timelib_time_ctor(); add_error(&in, "Empty string"); if (errors) { http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.re?r1=1.60&r2=1.61&diff_format=u Index: php-src/ext/date/lib/parse_date.re diff -u php-src/ext/date/lib/parse_date.re:1.60 php-src/ext/date/lib/parse_date.re:1.61 --- php-src/ext/date/lib/parse_date.re:1.60 Wed Sep 6 07:33:59 2006 +++ php-src/ext/date/lib/parse_date.re Sat Sep 9 12:25:54 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: parse_date.re,v 1.60 2006/09/06 07:33:59 derick Exp $ */ +/* $Id: parse_date.re,v 1.61 2006/09/09 12:25:54 derick Exp $ */ #include "timelib.h" @@ -1522,11 +1522,13 @@ in.errors->error_count = 0; in.errors->error_messages = NULL; - while (isspace(*s) && s < e) { - s++; - } - while (isspace(*e) && e > s) { - e--; + if (len > 0) { + while (isspace(*s) && s < e) { + s++; + } + while (isspace(*e) && e > s) { + e--; + } } if (e - s < 1) { in.time = timelib_time_ctor(); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/date/lib parse_date.c parse_date.re /ext/date/tests date_default_timezone_get-1.phpt date_default_timezone_set-1.phpt
iliaa Sun Dec 18 16:20:12 2005 EDT Modified files: /php-src/ext/date/tests date_default_timezone_set-1.phpt date_default_timezone_get-1.phpt /php-src/ext/date/lib parse_date.c parse_date.re Log: MFB51: Fixed UTC handling problem stemming from an earlier fix for bug #35422. http://cvs.php.net/viewcvs.cgi/php-src/ext/date/tests/date_default_timezone_set-1.phpt?r1=1.5&r2=1.6&diff_format=u Index: php-src/ext/date/tests/date_default_timezone_set-1.phpt diff -u php-src/ext/date/tests/date_default_timezone_set-1.phpt:1.5 php-src/ext/date/tests/date_default_timezone_set-1.phpt:1.6 --- php-src/ext/date/tests/date_default_timezone_set-1.phpt:1.5 Tue Nov 29 16:25:39 2005 +++ php-src/ext/date/tests/date_default_timezone_set-1.phpt Sun Dec 18 16:20:11 2005 @@ -18,11 +18,11 @@ echo date(date::ISO8601, $date4), "\n"; ?> --EXPECTF-- -Strict Standards: strtotime(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We selected 'UTC' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_set-1.php on line 3 +Strict Standards: strtotime(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We selected 'Europe/London' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_set-1.php on line 3 -Strict Standards: strtotime(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We selected 'UTC' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_set-1.php on line 4 +Strict Standards: strtotime(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We selected 'Europe/London' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_set-1.php on line 4 America/Indiana/Knox 2005-01-12T03:00:00-0500 -2005-07-12T03:00:00-0500 +2005-07-12T02:00:00-0500 2005-01-12T08:00:00-0500 2005-07-12T08:00:00-0500 http://cvs.php.net/viewcvs.cgi/php-src/ext/date/tests/date_default_timezone_get-1.phpt?r1=1.5&r2=1.6&diff_format=u Index: php-src/ext/date/tests/date_default_timezone_get-1.phpt diff -u php-src/ext/date/tests/date_default_timezone_get-1.phpt:1.5 php-src/ext/date/tests/date_default_timezone_get-1.phpt:1.6 --- php-src/ext/date/tests/date_default_timezone_get-1.phpt:1.5 Tue Nov 29 16:25:39 2005 +++ php-src/ext/date/tests/date_default_timezone_get-1.phpt Sun Dec 18 16:20:11 2005 @@ -9,8 +9,8 @@ echo date('e'), "\n"; ?> --EXPECTF-- -Strict Standards: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We selected 'UTC' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_get-1.php on line 3 -UTC +Strict Standards: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We selected 'Europe/London' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_get-1.php on line 3 +Europe/London -Strict Standards: date(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We selected 'UTC' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_get-1.php on line 4 -UTC \ No newline at end of file +Strict Standards: date(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We selected 'Europe/London' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_get-1.php on line 4 +Europe/London \ No newline at end of file http://cvs.php.net/viewcvs.cgi/php-src/ext/date/lib/parse_date.c?r1=1.48&r2=1.49&diff_format=u Index: php-src/ext/date/lib/parse_date.c diff -u php-src/ext/date/lib/parse_date.c:1.48 php-src/ext/date/lib/parse_date.c:1.49 --- php-src/ext/date/lib/parse_date.c:1.48 Fri Dec 16 22:40:08 2005 +++ php-src/ext/date/lib/parse_date.c Sun Dec 18 16:20:11 2005 @@ -1,4 +1,4 @@ -/* Generated by re2c 0.9.11.rc1 on Fri Dec 16 17:38:44 2005 */ +/* Generated by re2c 0.9.11.rc1 on Sun Dec 18 11:18:45 2005 */ #line 1 "ext/date/lib/parse_date.re" /* +--+ @@ -18,7 +18,7 @@ +--+ */ -/* $Id: parse_date.c,v 1.48 2005/12/16 22:40:08 iliaa Exp $ */ +/* $Id: parse_date.c,v
[PHP-CVS] cvs: php-src /ext/date/lib parse_date.c parse_date.re /ext/date/tests bug35705.phpt
iliaa Fri Dec 16 22:40:09 2005 EDT Modified files: /php-src/ext/date/lib parse_date.c parse_date.re /php-src/ext/date/tests bug35705.phpt Log: MFB51: Fixed bug #35705 (strtotime() fails to parse soap date format without TZ). http://cvs.php.net/viewcvs.cgi/php-src/ext/date/lib/parse_date.c?r1=1.47&r2=1.48&diff_format=u Index: php-src/ext/date/lib/parse_date.c diff -u php-src/ext/date/lib/parse_date.c:1.47 php-src/ext/date/lib/parse_date.c:1.48 --- php-src/ext/date/lib/parse_date.c:1.47 Tue Dec 13 02:29:52 2005 +++ php-src/ext/date/lib/parse_date.c Fri Dec 16 22:40:08 2005 @@ -1,4 +1,4 @@ -/* Generated by re2c 0.9.11.rc1 on Mon Dec 12 21:29:37 2005 */ +/* Generated by re2c 0.9.11.rc1 on Fri Dec 16 17:38:44 2005 */ #line 1 "ext/date/lib/parse_date.re" /* +--+ @@ -18,7 +18,7 @@ +--+ */ -/* $Id: parse_date.c,v 1.47 2005/12/13 02:29:52 iliaa Exp $ */ +/* $Id: parse_date.c,v 1.48 2005/12/16 22:40:08 iliaa Exp $ */ #include "timelib.h" @@ -850,7 +850,7 @@ yy3: YYDEBUG(3, *YYCURSOR); -#line 1321 "ext/date/lib/parse_date.re" +#line 1323 "ext/date/lib/parse_date.re" { int tz_not_found; DEBUG_OUTPUT("tzcorrection | tz"); @@ -978,7 +978,7 @@ yy8: YYDEBUG(8, *YYCURSOR); -#line 1387 "ext/date/lib/parse_date.re" +#line 1389 "ext/date/lib/parse_date.re" { /* printf("unexpected character: #%d, %c ", *s->tok, *s->tok); */ s->errors++; @@ -2023,7 +2023,7 @@ yy45: YYDEBUG(45, *YYCURSOR); -#line 1376 "ext/date/lib/parse_date.re" +#line 1378 "ext/date/lib/parse_date.re" { goto std; } @@ -2039,7 +2039,7 @@ yy48: YYDEBUG(48, *YYCURSOR); -#line 1381 "ext/date/lib/parse_date.re" +#line 1383 "ext/date/lib/parse_date.re" { s->pos = cursor; s->line++; goto std; @@ -2252,7 +2252,7 @@ yy68: YYDEBUG(68, *YYCURSOR); -#line 1360 "ext/date/lib/parse_date.re" +#line 1362 "ext/date/lib/parse_date.re" { timelib_ull i; DEBUG_OUTPUT("relative"); @@ -3244,7 +3244,7 @@ yy173: YYDEBUG(173, *YYCURSOR); -#line 1304 "ext/date/lib/parse_date.re" +#line 1306 "ext/date/lib/parse_date.re" { timelib_sll i; int behavior; @@ -5022,7 +5022,7 @@ yy342: YYDEBUG(342, *YYCURSOR); -#line 1288 "ext/date/lib/parse_date.re" +#line 1290 "ext/date/lib/parse_date.re" { const timelib_relunit* relunit; DEBUG_OUTPUT("daytext"); @@ -6306,7 +6306,7 @@ yy432: YYDEBUG(432, *YYCURSOR); -#line 1332 "ext/date/lib/parse_date.re" +#line 1334 "ext/date/lib/parse_date.re" { int tz_not_found; DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz"); @@ -7164,7 +7164,7 @@ yy495: YYDEBUG(495, *YYCURSOR); -#line 1219 "ext/date/lib/parse_date.re" +#line 1221 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("pgtextshort"); TIMELIB_INIT; @@ -9028,7 +9028,7 @@ yy597: YYDEBUG(597, *YYCURSOR); -#line 1273 "ext/date/lib/parse_date.re" +#line 1275 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("ago"); TIMELIB_INIT; @@ -13432,7 +13432,7 @@ yy903: YYDEBUG(903, *YYCURSOR); -#line 1245 "ext/date/lib/parse_date.re" +#line 1247 "ext/date/lib/parse_date.re" { int tz_not_found; DEBUG_OUTPUT("clf"); @@ -13850,7 +13850,7 @@ yy956: YYDEBUG(956, *YYCURSOR); -#line 1232 "ext/date/lib/parse_date.re" +#line 1234 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("pgtextreverse"); TIMELIB_INIT; @@ -13995,7 +13995,7 @@ yy968: YYDEBUG(968, *YYCURSOR); -#line 1264 "ext/date/lib/parse_date.re" +#line 1266 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("year4"); TIMELIB_INIT; @@ -14360,7 +14360,7 @@ yy997: YYDEBUG(997, *YYCURSOR); -#line 1200 "ext/date/lib/parse_date.re" +#line 1202 "ext/date/lib/parse_date.re" { timelib_sll w, d; DEBUG_OUTPUT("isoweek"); @@ -14386,7 +14386,7 @@ yy999: YYDEBUG(999, *YYCURSOR); -#line 1181 "ext/date/lib/parse_date.re" +#line 1183 "ext/date/lib/parse_date.re" { timelib_sll w, d; DEBUG_OUTPUT("isoweekday"); @@ -14473,7 +14473,7 @@ yy1003: YYDEBUG(1003, *YYCURSOR); -#line 1168 "ext/date/lib/parse_date.re" +#line 1170 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("pgydotd"); TIMELIB_INIT; @@ -14715,13 +14715,15 @@ s->time->s = timelib_get_nr((char **) &ptr, 2); if (*ptr == '.') { s->time->f = timelib_get_frac_nr((ch