diff options
| author | A1029384756 <hayden.gray104@gmail.com> | 2025-12-11 23:13:38 -0500 |
|---|---|---|
| committer | A1029384756 <hayden.gray104@gmail.com> | 2025-12-11 23:13:38 -0500 |
| commit | 7b635c031f8e795bd36d70d9559909f3ad6f8c8a (patch) | |
| tree | f73297c31934f80ea31ca58b693e17f20a27adc6 | |
| parent | ab9a05ed2d2e0eb76ef53709f91c54534aee543a (diff) | |
[tz_unix] added additional search paths to match musl
| -rw-r--r-- | core/time/timezone/tz_unix.odin | 14 |
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 } |