time: allow leap seconds when parsing RFC3339

we don't ever produce those, but they are valid RFC3339 strings

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2020-09-15 12:20:51 +02:00 committed by Dietmar Maurer
parent ed7c58cf47
commit ceefaa8095

View File

@ -257,7 +257,7 @@ pub fn parse_rfc3339(i: &str) -> Result<i64, Error> {
expect(13, b':')?; expect(13, b':')?;
tm.set_min(check_max(digit(14)?*10 + digit(15)?, 59)?)?; tm.set_min(check_max(digit(14)?*10 + digit(15)?, 59)?)?;
expect(16, b':')?; expect(16, b':')?;
tm.set_sec(check_max(digit(17)?*10 + digit(18)?, 59)?)?; tm.set_sec(check_max(digit(17)?*10 + digit(18)?, 60)?)?;
let epoch = tm.into_epoch()?; let epoch = tm.into_epoch()?;
if tz == b'Z' { if tz == b'Z' {