diff options
author | Kevin B Kenny <kennykb@acm.org> | 2012-01-08 20:43:56 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2012-01-08 20:43:56 (GMT) |
commit | 6ee0348cd69bd13d1817b423952ab4b81fd9f8d8 (patch) | |
tree | ebe9219ad6d1f8ef3e4b38b5ebeb54f43e23ac2e /library | |
parent | 756c75aca3c93977c770237c4c602f7161470478 (diff) | |
download | tcl-6ee0348cd69bd13d1817b423952ab4b81fd9f8d8.zip tcl-6ee0348cd69bd13d1817b423952ab4b81fd9f8d8.tar.gz tcl-6ee0348cd69bd13d1817b423952ab4b81fd9f8d8.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 2e9cae7..32911b3 100644 --- a/library/clock.tcl +++ b/library/clock.tcl @@ -3494,7 +3494,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" } @@ -3584,8 +3584,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, |