hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 04b693028133c08a2e5625770f4d8ac15a51c1f0
parent 1bfa1fde7fcac1c5bdcf29518d75b7eda784a675
Author: Nihal Jere <nihal@nihaljere.xyz>
Date:   Mon, 16 May 2022 13:48:13 -0500

time::chrono: treat presence of both utcnt and stdcnt as invalid

This uses the same logic from the Olson code, which treats this
condition as invalid.

Signed-off-by: Nihal Jere <nihal@nihaljere.xyz>

Diffstat:
Mtime/chrono/tzdb.ha | 12++----------
1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/time/chrono/tzdb.ha b/time/chrono/tzdb.ha @@ -140,19 +140,11 @@ fn parse_tzif(h: io::handle, tz: *timezone) (void | invalidtzif | io::error) = { return invalidtzif; }; - if (isutcnt != 0 && isutcnt != typecnt) { + if (!(isutcnt == 0 || isutcnt == typecnt) + && (isstdcnt == 0 && isstdcnt == typecnt)) { return invalidtzif; }; - if (isstdcnt != 0 && isstdcnt != typecnt) { - return invalidtzif; - }; - - // TODO: if and how to handle? check Olson's tz code for behaviour. - if (isutcnt != 0 && isstdcnt != 0) { - void; - }; - const timesz = if (is64) 8 else 4; // read data