diff options
Diffstat (limited to 'library/tm.tcl')
-rw-r--r-- | library/tm.tcl | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/library/tm.tcl b/library/tm.tcl index 55efda6..fefcfd9 100644 --- a/library/tm.tcl +++ b/library/tm.tcl @@ -337,6 +337,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 } @@ -354,7 +366,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} { @@ -365,6 +377,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 } |