git: 9front

Download patch

ref: d54c7c9f6328bd1da9fef69ba4b2dcde741fc872
parent: 2b719145934fa898a21cd9c2de62860fa9a50781
author: Alex Musolino <alex@musolino.id.au>
date: Thu Oct 31 05:41:03 EDT 2019

upas/fs: fix handling of numeric timezone offsets in strtotm

Since numeric timezone offsets are relative to GMT, initialise zone to
GMT so tm2sec(2) does not assume local time.

Note that if strtotm encounters a timezone *string* and consequently
overwrites zone then we will end up in the same mess since tm2sec(2)
only deals with GMT or local time.

--- a/sys/src/cmd/upas/fs/strtotm.c
+++ b/sys/src/cmd/upas/fs/strtotm.c
@@ -38,6 +38,7 @@
 	tm.min = -1;
 	tm.year = -1;
 	tm.mday = -1;
+	memcpy(tm.zone, "GMT", 3);
 	for(p = skipwhite(p); *p; p = skipwhite(q)){
 		q = skiptext(p);
 
--