From c7abe4f351382c9ca53e29f9f8f181c0832ac70f Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Tue, 15 Jun 1999 14:01:13 +0000 Subject: [PATCH] * stime.c (bdtime2c): Initialize lt->gmtoff and lt->tm_zone from sbd_time. (Thanks to Eric Hanchrow.) --- libguile/stime.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libguile/stime.c b/libguile/stime.c index 16a444f5b..a99c19d80 100644 --- a/libguile/stime.c +++ b/libguile/stime.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,1997,1998, 1999 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -392,7 +392,8 @@ bdtime2c (SCM sbd_time, struct tm *lt, int pos, const char *subr) && SCM_INUMP (SCM_VELTS (sbd_time)[5]) && SCM_INUMP (SCM_VELTS (sbd_time)[6]) && SCM_INUMP (SCM_VELTS (sbd_time)[7]) - && SCM_INUMP (SCM_VELTS (sbd_time)[8]), + && SCM_INUMP (SCM_VELTS (sbd_time)[8]) + && SCM_STRINGP (SCM_VELTS (sbd_time)[10]), sbd_time, pos, subr); lt->tm_sec = SCM_INUM (SCM_VELTS (sbd_time)[0]); lt->tm_min = SCM_INUM (SCM_VELTS (sbd_time)[1]); @@ -403,6 +404,10 @@ bdtime2c (SCM sbd_time, struct tm *lt, int pos, const char *subr) lt->tm_wday = SCM_INUM (SCM_VELTS (sbd_time)[6]); lt->tm_yday = SCM_INUM (SCM_VELTS (sbd_time)[7]); lt->tm_isdst = SCM_INUM (SCM_VELTS (sbd_time)[8]); +#ifdef HAVE_TM_ZONE + lt->tm_gmtoff = SCM_INUM (SCM_VELTS (sbd_time)[9]); + lt->tm_zone = SCM_CHARS (SCM_VELTS (sbd_time)[10]); +#endif } SCM_PROC (s_mktime, "mktime", 1, 1, 0, scm_mktime);