diff options
author | apnadkarni <apnmbx-wits@yahoo.com> | 2022-08-19 17:02:47 (GMT) |
---|---|---|
committer | apnadkarni <apnmbx-wits@yahoo.com> | 2022-08-19 17:02:47 (GMT) |
commit | de7a5967d0f8c2bf87801e4ee9d95355997df774 (patch) | |
tree | 0c9a599faaf91a3fc0683b20a9fed2af64c2fcf1 | |
parent | e52c7c3a41a6fb4a3deeade3447de39ee569f0fd (diff) | |
download | tcl-de7a5967d0f8c2bf87801e4ee9d95355997df774.zip tcl-de7a5967d0f8c2bf87801e4ee9d95355997df774.tar.gz tcl-de7a5967d0f8c2bf87801e4ee9d95355997df774.tar.bz2 |
Do tilde expansion when initializing from TCLLIBPATH and TM env vars
-rw-r--r-- | library/init.tcl | 10 | ||||
-rw-r--r-- | library/tm.tcl | 5 |
2 files changed, 13 insertions, 2 deletions
diff --git a/library/init.tcl b/library/init.tcl index 31139dd..d2e3624 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -47,7 +47,15 @@ package require -exact tcl 9.0a4 if {![info exists auto_path]} { if {[info exists env(TCLLIBPATH)] && (![interp issafe])} { - set auto_path $env(TCLLIBPATH) + set auto_path [apply {{} { + lmap path $::env(TCLLIBPATH) { + # Paths relative to unresolvable home dirs are ignored + if {[catch {file tildeexpand $path} expanded_path]} { + continue + } + set expanded_path + } + }}] } else { set auto_path "" } diff --git a/library/tm.tcl b/library/tm.tcl index c1a8f8a..88ce4af 100644 --- a/library/tm.tcl +++ b/library/tm.tcl @@ -338,7 +338,10 @@ proc ::tcl::tm::Defaults {} { ] { if {![info exists env($ev)]} continue foreach p [split $env($ev) $sep] { - path add $p + # Paths relative to unresolvable home dirs are ignored + if {![catch {file tildeexpand $p} expanded_path]} { + path add $expanded_path + } } } } |