[glib: 1/8] gtimezone: get 64-bit data from version-3 TZif files
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 1/8] gtimezone: get 64-bit data from version-3 TZif files
- Date: Fri, 17 Jul 2020 13:54:54 +0000 (UTC)
commit 21b000356e19ab75ec7a0343b9ac30016f3523a8
Author: Paul Eggert <eggert cs ucla edu>
Date: Thu Jul 16 12:41:49 2020 -0700
gtimezone: get 64-bit data from version-3 TZif files
Version 3 was introduced in tzdb 2013e (2013).
See Internet RFC 8536 section 3.1 under "ver(sion)".
glib/gtimezone.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/glib/gtimezone.c b/glib/gtimezone.c
index 0bea41297b..358b52aa40 100644
--- a/glib/gtimezone.c
+++ b/glib/gtimezone.c
@@ -534,7 +534,7 @@ init_zone_from_iana_info (GTimeZone *gtz,
g_return_if_fail (size >= sizeof (struct tzhead) &&
memcmp (header, "TZif", 4) == 0);
- if (header->tzh_version == '2')
+ if (header->tzh_version >= '2')
{
/* Skip ahead to the newer 64-bit data if it's available. */
header = (const struct tzhead *)
@@ -574,7 +574,7 @@ init_zone_from_iana_info (GTimeZone *gtz,
for (index = 0; index < time_count; index++)
{
Transition trans;
- if (header->tzh_version == '2')
+ if (header->tzh_version >= '2')
trans.time = gint64_from_be (((gint64_be*)tz_transitions)[index]);
else
trans.time = gint32_from_be (((gint32_be*)tz_transitions)[index]);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]