diff options
author | Kevin B Kenny <kennykb@acm.org> | 2012-01-08 20:49:22 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2012-01-08 20:49:22 (GMT) |
commit | 151775da6be9a21f63775f08ea9f87818479ea89 (patch) | |
tree | b8f4fa7c3a644a757c2520705ad9f4a03644bbdf /library | |
parent | db503c0188238d20e1799f22766040e3c7eddcd9 (diff) | |
parent | 6ee0348cd69bd13d1817b423952ab4b81fd9f8d8 (diff) | |
download | tcl-151775da6be9a21f63775f08ea9f87818479ea89.zip tcl-151775da6be9a21f63775f08ea9f87818479ea89.tar.gz tcl-151775da6be9a21f63775f08ea9f87818479ea89.tar.bz2 |
Fix loading of timezones where one abbreviation is a proper suffix of another [Bug 3470928]
Diffstat (limited to 'library')
-rw-r--r-- | library/clock.tcl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/library/clock.tcl b/library/clock.tcl index 2a4c7bd..0696c47 100644 --- a/library/clock.tcl +++ b/library/clock.tcl @@ -3411,7 +3411,7 @@ proc ::tcl::clock::LoadZoneinfoFile { fileName } { proc ::tcl::clock::ReadZoneinfoFile {fileName fname} { variable MINWIDE variable TZData - if { ![info exists fname] } { + if { ![file exists $fname] } { return -code error "$fileName not found" } @@ -3502,8 +3502,10 @@ proc ::tcl::clock::ReadZoneinfoFile {fileName fname} { set i 0 set abbrevs {} foreach a $abbrList { - dict set abbrevs $i $a - incr i [expr { [string length $a] + 1 }] + for {set j 0} {$j <= [string length $a]} {incr j} { + dict set abbrevs $i [string range $a $j end] + incr i + } } # Package up a list of tuples, each of which contains transition time, |