From fd18074787d865ec86f5420c5610b6c778387736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Sch=C3=BCtz?= Date: Sat, 1 Feb 2014 20:19:07 +0100 Subject: [PATCH] Support TZif format v3 The only difference between v2 and v3 is an extension of the POSIX-TZ-style string, which Phobos doesn't use anyway. --- std/datetime.d | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/std/datetime.d b/std/datetime.d index d58a2a4dd..8e0faa800 100644 --- a/std/datetime.d +++ b/std/datetime.d @@ -29319,7 +29319,7 @@ assert(tz.dstName == "PDT"); _enforceValidTZFile(readVal!(char[])(tzFile, 4) == "TZif"); immutable char tzFileVersion = readVal!char(tzFile); - _enforceValidTZFile(tzFileVersion == '\0' || tzFileVersion == '2'); + _enforceValidTZFile(tzFileVersion == '\0' || tzFileVersion == '2' || tzFileVersion == '3'); { auto zeroBlock = readVal!(ubyte[])(tzFile, 15); @@ -29403,12 +29403,13 @@ assert(tz.dstName == "PDT"); _enforceValidTZFile(!tzFile.eof); - //If version 2, the information is duplicated in 64-bit. - if(tzFileVersion == '2') + //If version 2 or 3, the information is duplicated in 64-bit. + if(tzFileVersion == '2' || tzFileVersion == '3') { _enforceValidTZFile(readVal!(char[])(tzFile, 4) == "TZif"); - _enforceValidTZFile(readVal!(char)(tzFile) == '2'); + immutable char tzFileVersion2 = readVal!(char)(tzFile); + _enforceValidTZFile(tzFileVersion2 == '2' || tzFileVersion2 == '3'); { auto zeroBlock = readVal!(ubyte[])(tzFile, 15);