commit 999d029a5b062ef4ceb1e7e145eaa1c41e4bfcc5
parent 4dc7e1ae7b8c34bdb9847e902a6e2701a9bd43c3
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sun, 19 Apr 2026 20:53:42 +0200
libc/time: Handle no TZ as error
When the TZ environment variable is missed or empty we should
deal it like in the error case and initialize all the variables
to the UTC values.
Diffstat:
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/libc/arch/posix/_tzone.c b/src/libc/arch/posix/_tzone.c
@@ -234,14 +234,11 @@ _tzset(void)
tz = cache;
}
- start = end = -1;
-
- if (!s)
- goto adjust;
-
- if (next(s) == EOS)
+ if (!s || next(s) == EOS)
goto error;
+ start = end = -1;
+
if (!std())
goto error;
if (tok == EOS)