aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/time/timezone/tz_unix.odin14
1 files changed, 10 insertions, 4 deletions
diff --git a/core/time/timezone/tz_unix.odin b/core/time/timezone/tz_unix.odin
index 990e78d41..d940e47be 100644
--- a/core/time/timezone/tz_unix.odin
+++ b/core/time/timezone/tz_unix.odin
@@ -81,9 +81,15 @@ _region_load :: proc(_reg_str: string, allocator := context.allocator) -> (out_r
}
defer if _reg_str == "local" { delete(reg_str, allocator) }
- db_path := "/usr/share/zoneinfo"
- region_path := filepath.join({db_path, reg_str}, allocator)
- defer delete(region_path, allocator)
+ db_paths := []string{"/usr/share/zoneinfo", "/share/zoneinfo", "/etc/zoneinfo"}
+ for db_path in db_paths {
+ region_path := filepath.join({db_path, reg_str}, allocator)
+ defer delete(region_path, allocator)
- return load_tzif_file(region_path, reg_str, allocator)
+ if tz_reg, ok := load_tzif_file(region_path, reg_str, allocator); ok {
+ return tz_reg, true
+ }
+ }
+
+ return nil, false
}