diff options
author | dgp <dgp@users.sourceforge.net> | 2015-12-22 20:49:19 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2015-12-22 20:49:19 (GMT) |
commit | 36189b7eca7e68a19d5e4d9cdf712f3aef322398 (patch) | |
tree | 69feb1d982e3e0d1ae6f036033c4a32ebb2a3ed2 | |
parent | 8d9d336b0c2d9142cf90919d36ef75acc1627bc8 (diff) | |
parent | 003b3000368a5f8752fcee1444cf4ec1cee6fe62 (diff) | |
download | tcl-36189b7eca7e68a19d5e4d9cdf712f3aef322398.zip tcl-36189b7eca7e68a19d5e4d9cdf712f3aef322398.tar.gz tcl-36189b7eca7e68a19d5e4d9cdf712f3aef322398.tar.bz2 |
merge 8.5
-rw-r--r-- | changes | 4 | ||||
-rw-r--r-- | generic/tclClock.c | 9 |
2 files changed, 8 insertions, 5 deletions
@@ -7973,4 +7973,6 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich) 2015-11-20 (bug)[40f628] ListObjReplace callers fail to detect max (porter) ---- Released 8.5.19, December 1, 2015 --- http://core.tcl.tk/tcl/ for details +2015-12-11 (bug)[c9eb6b] tolerate unset ::env(TZ) (gahr, nijtmans) + +--- Released 8.5.19, January 31, 2016 --- http://core.tcl.tk/tcl/ for details diff --git a/generic/tclClock.c b/generic/tclClock.c index 3ec94fb..32ba145 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -1994,22 +1994,23 @@ ClockSecondsObjCmd( static void TzsetIfNecessary(void) { - static char* tzWas = NULL; /* Previous value of TZ, protected by + static char* tzWas = INT2PTR(-1); /* Previous value of TZ, protected by * clockMutex. */ const char* tzIsNow; /* Current value of TZ */ Tcl_MutexLock(&clockMutex); tzIsNow = getenv("TZ"); - if (tzIsNow != NULL && (tzWas == NULL || strcmp(tzIsNow, tzWas) != 0)) { + if (tzIsNow != NULL && (tzWas == NULL || tzWas == INT2PTR(-1) + || strcmp(tzIsNow, tzWas) != 0)) { tzset(); - if (tzWas != NULL) { + if (tzWas != NULL && tzWas != INT2PTR(-1)) { ckfree(tzWas); } tzWas = ckalloc(strlen(tzIsNow) + 1); strcpy(tzWas, tzIsNow); } else if (tzIsNow == NULL && tzWas != NULL) { tzset(); - ckfree(tzWas); + if (tzWas != INT2PTR(-1)) ckfree(tzWas); tzWas = NULL; } Tcl_MutexUnlock(&clockMutex); |