X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/66d1ace8410db940b6d1c74986626557ef8098ba..92345b0a01c6c0142d2e3582275cd582743a729b:/luatz/tzfile.lua diff --git a/luatz/tzfile.lua b/luatz/tzfile.lua index eed426e..96686dc 100644 --- a/luatz/tzfile.lua +++ b/luatz/tzfile.lua @@ -39,7 +39,7 @@ end local fifteen_nulls = ("\0"):rep(15) local function read_tz ( fd ) - assert ( fd:read(4) == "TZif" ) + assert ( fd:read(4) == "TZif" , "Invalid TZ file" ) local version = assert ( fd:read(1) ) if version == "\0" or version == "2" then local MIN_TIME = -2^32+1 @@ -198,7 +198,7 @@ local function read_tz ( fd ) end local function read_tzfile ( path ) - local fd = assert ( io.open ( path ) ) + local fd = assert ( io.open ( path , "rb" ) ) local tzinfo = read_tz ( fd ) fd:close ( ) return tzinfo