Skip to content

Commit

Permalink
don't overwrite last setup-tz cache via gmt-tz (special case)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebres committed Mar 15, 2024
1 parent c4e6e25 commit 42649e0
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions generic/tclClock.c
Original file line number Diff line number Diff line change
Expand Up @@ -943,21 +943,24 @@ TimezoneLoaded(
Tcl_Obj *timezoneObj, /* Name of zone was loaded */
Tcl_Obj *tzUnnormObj) /* Name of zone was loaded */
{
/* don't overwrite last-setup with GMT (special case) */
if (timezoneObj == dataPtr->literals[LIT_GMT]) {
/* mark GMT zone loaded */
if (dataPtr->gmtSetupTimeZone == NULL) {
Tcl_SetObjRef(dataPtr->gmtSetupTimeZone,
dataPtr->literals[LIT_GMT]);
}
Tcl_SetObjRef(dataPtr->gmtSetupTimeZoneUnnorm, tzUnnormObj);
return;
}

/* last setup zone loaded */
if (dataPtr->lastSetupTimeZone != timezoneObj) {
SavePrevTimezoneObj(dataPtr);
Tcl_SetObjRef(dataPtr->lastSetupTimeZone, timezoneObj);
Tcl_UnsetObjRef(dataPtr->lastSetupTZData);
}
Tcl_SetObjRef(dataPtr->lastSetupTimeZoneUnnorm, tzUnnormObj);

/* mark GMT zone loaded */
if ( dataPtr->gmtSetupTimeZone == NULL
&& timezoneObj == dataPtr->literals[LIT_GMT]
) {
Tcl_SetObjRef(dataPtr->gmtSetupTimeZone,
dataPtr->literals[LIT_GMT]);
}
}
/*
*----------------------------------------------------------------------
Expand Down

0 comments on commit 42649e0

Please sign in to comment.