summaryrefslogtreecommitdiffstats
path: root/library/tm.tcl
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2008-06-25 17:40:01 (GMT)
committerandreas_kupries <akupries@shaw.ca>2008-06-25 17:40:01 (GMT)
commitb07cd69442347c48d45759b7ca2b772857dcf49f (patch)
tree0b859d76d3197b329d5b14a73f4d332f70df42aa /library/tm.tcl
parentfbaaddabb7cc63723d7724a1d568c9b917dc7a5f (diff)
downloadtcl-b07cd69442347c48d45759b7ca2b772857dcf49f.zip
tcl-b07cd69442347c48d45759b7ca2b772857dcf49f.tar.gz
tcl-b07cd69442347c48d45759b7ca2b772857dcf49f.tar.bz2
* library/tm.tcl: Modified the handling of Tcl Modules and of the
* library/safe.tcl: Safe Base to interact nicely with each other, * library/init.tcl: enabling requiring Tcl Modules in safe * tests/safe.test: interpreters. Fixes [Bug 1999119].
Diffstat (limited to 'library/tm.tcl')
-rw-r--r--library/tm.tcl14
1 files changed, 9 insertions, 5 deletions
diff --git a/library/tm.tcl b/library/tm.tcl
index aee74f5..f6ffe5d 100644
--- a/library/tm.tcl
+++ b/library/tm.tcl
@@ -214,11 +214,11 @@ proc ::tcl::tm::UnknownHandler {original name args} {
set satisfied 0
foreach path $paths {
- if {![file exists $path]} {
+ if {![interp issafe] && ![file exists $path]} {
continue
}
set currentsearchpath [file join $path $pkgroot]
- if {![file exists $currentsearchpath]} {
+ if {![interp issafe] && ![file exists $currentsearchpath]} {
continue
}
set strip [llength [file split $path]]
@@ -352,9 +352,13 @@ proc ::tcl::tm::roots {paths} {
foreach pa $paths {
set p [file join $pa tcl$major]
for {set n $minor} {$n >= 0} {incr n -1} {
- path add [file normalize [file join $p ${major}.${n}]]
+ set px [file join $p ${major}.${n}]
+ if {![interp issafe]} { set px [file normalize $px] }
+ path add $px
}
- path add [file normalize [file join $p site-tcl]]
+ set px [file join $p site-tcl]
+ if {![interp issafe]} { set px [file normalize $px] }
+ path add $px
}
return
}
@@ -362,4 +366,4 @@ proc ::tcl::tm::roots {paths} {
# Initialization. Set up the default paths, then insert the new
# handler into the chain.
-::tcl::tm::Defaults
+if {![interp issafe]} { ::tcl::tm::Defaults }