diff options
author | dgp <dgp@users.sourceforge.net> | 2011-10-19 12:10:58 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2011-10-19 12:10:58 (GMT) |
commit | df806f842480e649fc047266bf38f41171482b28 (patch) | |
tree | e7ca4cd91015e7181aae2373a5fc63ef89f917a3 /library | |
parent | a9b46378b141ec445ac4351a36a2f7a38fcbc0b3 (diff) | |
parent | ab5335a4c951b478bbedd4f5561b8a314da5b074 (diff) | |
download | tcl-remove_pathappend_intrep.zip tcl-remove_pathappend_intrep.tar.gz tcl-remove_pathappend_intrep.tar.bz2 |
merge trunkremove_pathappend_intrep
Diffstat (limited to 'library')
-rw-r--r-- | library/clock.tcl | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/library/clock.tcl b/library/clock.tcl index b6ff359..2a4c7bd 100644 --- a/library/clock.tcl +++ b/library/clock.tcl @@ -3012,18 +3012,23 @@ proc ::tcl::clock::GetSystemTimeZone {} { set timezone $result } elseif {[set result [getenv TZ]] ne {}} { set timezone $result - } elseif { [info exists CachedSystemTimeZone] } { - set timezone $CachedSystemTimeZone - } elseif { $::tcl_platform(platform) eq {windows} } { - set timezone [GuessWindowsTimeZone] - } elseif { [file exists /etc/localtime] - && ![catch {ReadZoneinfoFile \ - Tcl/Localtime /etc/localtime}] } { - set timezone :Tcl/Localtime - } else { - set timezone :localtime } - set CachedSystemTimeZone $timezone + if {![info exists timezone]} { + # Cache the time zone only if it was detected by one of the + # expensive methods. + if { [info exists CachedSystemTimeZone] } { + set timezone $CachedSystemTimeZone + } elseif { $::tcl_platform(platform) eq {windows} } { + set timezone [GuessWindowsTimeZone] + } elseif { [file exists /etc/localtime] + && ![catch {ReadZoneinfoFile \ + Tcl/Localtime /etc/localtime}] } { + set timezone :Tcl/Localtime + } else { + set timezone :localtime + } + set CachedSystemTimeZone $timezone + } if { ![dict exists $TimeZoneBad $timezone] } { dict set TimeZoneBad $timezone [catch {SetupTimeZone $timezone}] } |