Update of /cvsroot/scsh/scsh-0.6/scsh
In directory usw-pr-cvs1:/tmp/cvs-serv29493
Modified Files:
time1.c
Log Message:
Prevent FreeBSD's strftime from segfaulting by setting tm_zone.
Index: time1.c
===================================================================
RCS file: /cvsroot/scsh/scsh-0.6/scsh/time1.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** time1.c 2001/09/07 12:36:30 1.6
--- time1.c 2001/10/19 13:26:56 1.7
***************
*** 323,327 ****
s48_value sch_hour, s48_value sch_mday,
s48_value sch_month, s48_value sch_year,
! s48_value tz, s48_value sch_summer,
s48_value sch_week_day, s48_value sch_year_day)
{
--- 323,327 ----
s48_value sch_hour, s48_value sch_mday,
s48_value sch_month, s48_value sch_year,
! s48_value sch_tz, s48_value sch_summer,
s48_value sch_week_day, s48_value sch_year_day)
{
***************
*** 350,353 ****
--- 350,357 ----
d.tm_isdst = (S48_EQ_P (sch_summer, S48_FALSE)) ? 0 : 1;
+ #ifdef HAVE_TM_ZONE
+ d.tm_zone = s48_extract_string(sch_tz); /* FreeBSD's strftime reads this
*/
+ #endif
+
/* Copy fmt -> fmt2, converting ~ escape codes to % escape codes.
** Set zone=1 if fmt has a ~Z.
***************
*** 405,410 ****
/* Fix up the time-zone if it is being used and the user passed one in. */
! if( zone && S48_STRING_P(tz) ) {
! oldenv = make_newenv(tz, newenv);
if( !oldenv ) {
int err = errno;
--- 409,414 ----
/* Fix up the time-zone if it is being used and the user passed one in. */
! if( zone && S48_STRING_P(sch_tz) ) {
! oldenv = make_newenv(sch_tz, newenv);
if( !oldenv ) {
int err = errno;
|