summaryrefslogtreecommitdiffstats
path: root/php-8.1.0-systzdata-v22.patch
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2022-02-23 13:57:24 +0100
committerRemi Collet <remi@php.net>2022-02-23 13:57:24 +0100
commit54da34cf75615c6ca813e44b455c37f194aada59 (patch)
treec7b76a33ee5f9a4ac3bd24f4106785a05cbf2f78 /php-8.1.0-systzdata-v22.patch
parent0fabf9106229789878ccfc9c865637913ee0dcdf (diff)
handle tzdata up to .26
Diffstat (limited to 'php-8.1.0-systzdata-v22.patch')
-rw-r--r--php-8.1.0-systzdata-v22.patch28
1 files changed, 19 insertions, 9 deletions
diff --git a/php-8.1.0-systzdata-v22.patch b/php-8.1.0-systzdata-v22.patch
index c66e66d..d1c8d90 100644
--- a/php-8.1.0-systzdata-v22.patch
+++ b/php-8.1.0-systzdata-v22.patch
@@ -58,7 +58,7 @@ index 18b8106bd2..3d1f63c758 100644
timelib_sources="lib/astro.c lib/dow.c lib/parse_date.c lib/parse_tz.c lib/parse_posix.c
lib/timelib.c lib/tm2unixtime.c lib/unixtime2tm.c lib/parse_iso_intervals.c lib/interval.c"
diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c
-index e41315efdb..689cfbd0a8 100644
+index e41315efdb..4b6547c0a3 100644
--- a/ext/date/lib/parse_tz.c
+++ b/ext/date/lib/parse_tz.c
@@ -26,9 +26,22 @@
@@ -96,7 +96,7 @@ index e41315efdb..689cfbd0a8 100644
/* read ID */
version = (*tzf)[3] - '0';
*tzf += 4;
-@@ -577,7 +595,457 @@ void timelib_dump_tzinfo(timelib_tzinfo *tz)
+@@ -577,7 +595,467 @@ void timelib_dump_tzinfo(timelib_tzinfo *tz)
}
}
@@ -344,8 +344,18 @@ index e41315efdb..689cfbd0a8 100644
+ isdigit(buf[12]) &&
+ isdigit(buf[13]) &&
+ islower(buf[14])) {
-+ buf[16] = 0;
-+ buf[15] = buf[14] - 'a' + '1';
++ if (buf[14] >= 't') { /* 2022t = 2022.20 */
++ buf[17] = 0;
++ buf[16] = buf[14] - 't' + '0';
++ buf[15] = '2';
++ } else if (buf[14] >= 'j') { /* 2022j = 2022.10 */
++ buf[17] = 0;
++ buf[16] = buf[14] - 'j' + '0';
++ buf[15] = '1';
++ } else { /* 2022a = 2022.1 */
++ buf[16] = 0;
++ buf[15] = buf[14] - 'a' + '1';
++ }
+ buf[14] = '.';
+ db->version = buf+10;
+ }
@@ -555,7 +565,7 @@ index e41315efdb..689cfbd0a8 100644
{
int left = 0, right = tzdb->index_size - 1;
-@@ -603,9 +1071,49 @@ static int seek_to_tz_position(const unsigned char **tzf, const char *timezone,
+@@ -603,9 +1081,49 @@ static int seek_to_tz_position(const unsigned char **tzf, const char *timezone,
return 0;
}
@@ -605,7 +615,7 @@ index e41315efdb..689cfbd0a8 100644
}
const timelib_tzdb_index_entry *timelib_timezone_identifiers_list(const timelib_tzdb *tzdb, int *count)
-@@ -617,7 +1125,30 @@ const timelib_tzdb_index_entry *timelib_timezone_identifiers_list(const timelib_
+@@ -617,7 +1135,30 @@ const timelib_tzdb_index_entry *timelib_timezone_identifiers_list(const timelib_
int timelib_timezone_id_is_valid(const char *timezone, const timelib_tzdb *tzdb)
{
const unsigned char *tzf;
@@ -637,7 +647,7 @@ index e41315efdb..689cfbd0a8 100644
}
static int skip_64bit_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
-@@ -662,6 +1193,8 @@ static timelib_tzinfo* timelib_tzinfo_ctor(const char *name)
+@@ -662,6 +1203,8 @@ static timelib_tzinfo* timelib_tzinfo_ctor(const char *name)
timelib_tzinfo *timelib_parse_tzfile(const char *timezone, const timelib_tzdb *tzdb, int *error_code)
{
const unsigned char *tzf;
@@ -646,7 +656,7 @@ index e41315efdb..689cfbd0a8 100644
timelib_tzinfo *tmp;
int version;
int transitions_result, types_result;
-@@ -669,7 +1202,7 @@ timelib_tzinfo *timelib_parse_tzfile(const char *timezone, const timelib_tzdb *t
+@@ -669,7 +1212,7 @@ timelib_tzinfo *timelib_parse_tzfile(const char *timezone, const timelib_tzdb *t
*error_code = TIMELIB_ERROR_NO_ERROR;
@@ -655,7 +665,7 @@ index e41315efdb..689cfbd0a8 100644
tmp = timelib_tzinfo_ctor(timezone);
version = read_preamble(&tzf, tmp, &type);
-@@ -712,11 +1245,36 @@ timelib_tzinfo *timelib_parse_tzfile(const char *timezone, const timelib_tzdb *t
+@@ -712,11 +1255,36 @@ timelib_tzinfo *timelib_parse_tzfile(const char *timezone, const timelib_tzdb *t
return NULL;
}