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