From e652b54fefa8f2c332b8d9841b7f97ad8b8d4f36 Mon Sep 17 00:00:00 2001 From: Gary Houston Date: Mon, 15 May 2000 21:23:31 +0000 Subject: [PATCH] 2000-05-15 Gary Houston * stime.c (scm_strftime): don't reset TZ if zone is an empty string. append a "0" to the zone for TZ. --- libguile/stime.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/libguile/stime.c b/libguile/stime.c index 601191d33..03095d1a1 100644 --- a/libguile/stime.c +++ b/libguile/stime.c @@ -580,14 +580,22 @@ SCM_DEFINE (scm_strftime, "strftime", 2, 0, 0, until TZ is restored. */ char **oldenv = NULL; SCM *velts = SCM_VELTS (stime); + int have_zone = 0; - if (SCM_NFALSEP (velts[10])) + if (SCM_NFALSEP (velts[10]) && *SCM_CHARS (velts[10]) != 0) { /* it's not required that the TZ setting be correct, just that - it has the right name. so try something like TZ=EST. - possibly TZ=EST0 would be better. */ + it has the right name. so try something like TZ=EST0. + using only TZ=EST would be simpler but it doesn't work on + some OSs, e.g., Solaris. */ + SCM zone = + scm_string_append (scm_cons (velts[10], + scm_cons (scm_makfrom0str ("0"), + SCM_EOL))); + + have_zone = 1; SCM_DEFER_INTS; - oldenv = setzone (velts[10], SCM_ARG2, FUNC_NAME); + oldenv = setzone (zone, SCM_ARG2, FUNC_NAME); } #endif @@ -603,7 +611,7 @@ SCM_DEFINE (scm_strftime, "strftime", 2, 0, 0, } #if !defined (HAVE_TM_ZONE) - if (SCM_NFALSEP (velts[10])) + if (have_zone) { restorezone (velts[10], oldenv, FUNC_NAME); SCM_ALLOW_INTS;