From ec368da1e0abf4367784d6a44e280fdc482c571f Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 18 Aug 2014 15:06:06 -0400 Subject: [PATCH] luatz/tzfile: Read in (but don't yet use) TZ string --- luatz/tzfile.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/luatz/tzfile.lua b/luatz/tzfile.lua index a0f8da5..36fd8a7 100644 --- a/luatz/tzfile.lua +++ b/luatz/tzfile.lua @@ -95,6 +95,8 @@ local function read_tz ( fd ) local isgmt = assert ( read_flags ( fd , tzh_ttisgmtcnt ) ) + local TZ + if version == "2" then --[[ For version-2-format timezone files, the above header and data is followed by a second header and data, @@ -157,6 +159,12 @@ local function read_tz ( fd ) for use in handling instants after the last transition time stored in the file (with nothing between the newlines if there is no POSIX representation for such instants). ]] + assert ( assert ( fd:read ( 1 ) ) == "\n" , "Expected newline at end of version 2 header" ) + + TZ = assert ( fd:read ( "*l" ) ) + if #TZ == 0 then + TZ = nil + end end for i=1, tzh_typecnt do -- 2.39.2