From d6d9e957467ab5ef0b48b66645ef2433c9a28695 Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Sat, 6 Mar 2004 22:41:26 +0000 Subject: [PATCH] (scm_gmtime): Return bd_time->tm_zone when available, rather than "GMT" always. (filltime): Make zname parameter "const". --- libguile/stime.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libguile/stime.c b/libguile/stime.c index 8ba1ced8e..0b70920d2 100644 --- a/libguile/stime.c +++ b/libguile/stime.c @@ -255,7 +255,7 @@ SCM_DEFINE (scm_gettimeofday, "gettimeofday", 0, 0, 0, #undef FUNC_NAME static SCM -filltime (struct tm *bd_time, int zoff, char *zname) +filltime (struct tm *bd_time, int zoff, const char *zname) { SCM result = scm_c_make_vector (11, SCM_UNDEFINED); @@ -405,6 +405,7 @@ SCM_DEFINE (scm_gmtime, "gmtime", 1, 0, 0, timet itime; struct tm *bd_time; SCM result; + const char *zname; itime = SCM_NUM2LONG (1, time); SCM_DEFER_INTS; @@ -414,7 +415,12 @@ SCM_DEFINE (scm_gmtime, "gmtime", 1, 0, 0, bd_time = gmtime (&itime); if (bd_time == NULL) SCM_SYSERROR; - result = filltime (bd_time, 0, "GMT"); +#if HAVE_STRUCT_TM_TM_ZONE + zname = bd_time->tm_zone; +#else + zname = "GMT"; +#endif + result = filltime (bd_time, 0, zname); SCM_ALLOW_INTS; return result; }