From 0628b66c3e909e64c03c6f0c19a07ede507a8cba Mon Sep 17 00:00:00 2001 From: sperber Date: Fri, 15 Apr 2005 14:58:57 +0000 Subject: [PATCH] The format_date function tries to fill the (non-POSIX) tm_zone field of struct tm, assuming the corresponding argument is a string. By the scsh documentation, #f is allowed, too. So just use NULL in that case instead of raising an argument-type exception, as was the case previously. --- scsh/time1.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scsh/time1.c b/scsh/time1.c index 19d4146..d9b0d50 100644 --- a/scsh/time1.c +++ b/scsh/time1.c @@ -333,7 +333,8 @@ s48_value format_date(s48_value sch_fmt, s48_value sch_sec, s48_value sch_min, d.tm_isdst = (S48_EQ_P (sch_summer, S48_FALSE)) ? 0 : 1; #ifdef HAVE_STRUCT_TM_TM_ZONE - d.tm_zone = s48_extract_string(sch_tz); /* FreeBSD's strftime reads this */ + /* FreeBSD's strftime reads this */ + d.tm_zone = (S48_EQ_P(sch_tz, S48_FALSE)) ? NULL : s48_extract_string(sch_tz); #endif /* Copy fmt -> fmt2, converting ~ escape codes to % escape codes.