1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-11 22:31:12 +02:00

(scm_gmtime): Return bd_time->tm_zone when available, rather than "GMT" always.

(filltime): Make zname parameter "const".
This commit is contained in:
Kevin Ryde 2004-03-06 22:41:26 +00:00
parent 82ab7b189b
commit d6d9e95746

View file

@ -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;
}