From 65f6bdd35a219710268e2f0a71edc414eec2039f Mon Sep 17 00:00:00 2001 From: shivers Date: Mon, 10 Nov 1997 02:55:17 +0000 Subject: [PATCH] timezone code bullet-proofed a bit. --- scsh/time1.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scsh/time1.c b/scsh/time1.c index bfc0e7c..228f2b3 100644 --- a/scsh/time1.c +++ b/scsh/time1.c @@ -174,10 +174,12 @@ scheme_value time2date(int hi_secs, int lo_secs, scheme_value zone, #ifdef HAVE_GMTOFF *tz_secs = d.tm_gmtoff; #else - { char **oldenv = environ; /* Set TZ to UTC */ + { struct tm dcopy = d; + char **oldenv = environ; /* Set TZ to UTC */ environ=utc_env; /* time temporarily. */ tzset(); /* NetBSD, SunOS POSIX-noncompliance requires this. */ - *tz_secs = mktime(&d) - t; + dcopy.tm_isdst = 0; + *tz_secs = mktime(&dcopy) - t; /* mktime() may mung dcopy. */ environ=oldenv; } #endif