X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/fc4bb72e16e19ae81d6f8b797186996c0ae46f33..ba4cf5bdfc3e75c0366771a1cdda676e9ccbeeb3:/luatz/tzcache.lua?ds=sidebyside diff --git a/luatz/tzcache.lua b/luatz/tzcache.lua index 25a664d..98ced26 100644 --- a/luatz/tzcache.lua +++ b/luatz/tzcache.lua @@ -5,10 +5,12 @@ local local_zoneinfo_path = "/etc/localtime" local tz_cache = { } local function name_to_zoneinfo_path ( name ) - if name then - return base_zoneinfo_path .. name - else + if name == nil then return local_zoneinfo_path + elseif name:sub ( 1 , 1 ) == "/" then + return name + else + return base_zoneinfo_path .. name end end