summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2004-10-22 14:27:38 (GMT)
committerKevin B Kenny <kennykb@acm.org>2004-10-22 14:27:38 (GMT)
commit9f2e0752a6f6ab07ff0b2411c9a945ba52804aff (patch)
tree34ad284fc57b23779e572af23ea0751968d1f54c /library
parentca054492e8f0b534d337d8bbb1bedab26f3942a1 (diff)
downloadtcl-9f2e0752a6f6ab07ff0b2411c9a945ba52804aff.zip
tcl-9f2e0752a6f6ab07ff0b2411c9a945ba52804aff.tar.gz
tcl-9f2e0752a6f6ab07ff0b2411c9a945ba52804aff.tar.bz2
* library/clock.tcl: Fixed a typo where the fallback time zone
became ::localtime instead of :localtime. Fixed a bug where time zone names containing hyphens could not be loaded. Thanks to Todd M. Helfter <tmh@jumpgate.itsp.purdue.edu> for finding these bugs. * tests/clock.test: Added regression test cases that covers both bugs.
Diffstat (limited to 'library')
-rw-r--r--library/clock.tcl8
1 files changed, 4 insertions, 4 deletions
diff --git a/library/clock.tcl b/library/clock.tcl
index 95f7582..7fdc654 100644
--- a/library/clock.tcl
+++ b/library/clock.tcl
@@ -13,7 +13,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: clock.tcl,v 1.7 2004/10/21 03:53:10 kennykb Exp $
+# RCS: @(#) $Id: clock.tcl,v 1.8 2004/10/22 14:27:39 kennykb Exp $
#
#----------------------------------------------------------------------
@@ -2927,7 +2927,7 @@ proc ::tcl::clock::GetSystemTimeZone {} {
dict set TimeZoneBad $timezone [catch {SetupTimeZone $timezone}]
}
if { [dict get $TimeZoneBad $timezone] } {
- return ::localtime
+ return :localtime
} else {
return $timezone
}
@@ -3466,7 +3466,7 @@ proc ::tcl::clock::LoadTimeZoneFile { fileName } {
# this code is security sensitive. Make sure that the path name
# cannot escape the given directory.
- if { ![regexp {^[[:alpha:]_]+(?:/[[:alpha:]_]+)*$} $fileName] } {
+ if { ![regexp {^[[.-.][:alpha:]_]+(?:/[[.-.][:alpha:]_]+)*$} $fileName] } {
return -code error \
-errorcode [list CLOCK badTimeZone $:fileName] \
"time zone \":$fileName\" not valid"
@@ -3509,7 +3509,7 @@ proc ::tcl::clock::LoadZoneinfoFile { fileName } {
# this code is security sensitive. Make sure that the path name
# cannot escape the given directory.
- if { ![regexp {^[[:alpha:]_]+(?:/[[:alpha:]_]+)*$} $fileName] } {
+ if { ![regexp {^[[.-.][:alpha:]_]+(?:/[[.-.][:alpha:]_]+)*$} $fileName] } {
return -code error \
-errorcode [list CLOCK badTimeZone $:fileName] \
"time zone \":$fileName\" not valid"