summaryrefslogtreecommitdiffstats
path: root/library/tm.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'library/tm.tcl')
-rw-r--r--library/tm.tcl24
1 files changed, 23 insertions, 1 deletions
diff --git a/library/tm.tcl b/library/tm.tcl
index d2af4f5..74d93a5 100644
--- a/library/tm.tcl
+++ b/library/tm.tcl
@@ -328,6 +328,18 @@ proc ::tcl::tm::Defaults {} {
}
}
}
+ if {$major == 8} return
+ for {set n 7} {$n >= 0} {incr n -1} {
+ foreach ev [::list \
+ TCL8.${n}_TM_PATH \
+ TCL8_${n}_TM_PATH \
+ ] {
+ if {![info exists env($ev)]} continue
+ foreach p [split $env($ev) $sep] {
+ path add $p
+ }
+ }
+ }
return
}
@@ -345,7 +357,7 @@ proc ::tcl::tm::Defaults {} {
# Calls 'path add' to paths to the list of module search paths.
proc ::tcl::tm::roots {paths} {
- lassign [split [package present Tcl] .] major minor
+ regexp {^(\d+)\.(\d+)} [package present Tcl] - major minor
foreach pa $paths {
set p [file join $pa tcl$major]
for {set n $minor} {$n >= 0} {incr n -1} {
@@ -356,6 +368,16 @@ proc ::tcl::tm::roots {paths} {
set px [file join $p site-tcl]
if {![interp issafe]} {set px [file normalize $px]}
path add $px
+ if {$major == 8} continue
+ set p [file join $pa tcl8]
+ for {set n 7} {$n >= 0} {incr n -1} {
+ set px [file join $p 8.${n}]
+ if {![interp issafe]} {set px [file normalize $px]}
+ path add $px
+ }
+ set px [file join $p site-tcl]
+ if {![interp issafe]} {set px [file normalize $px]}
+ path add $px
}
return
}