Skip to content

Commit ab3a945

Browse files
author
jan.nijtmans
committed
Update docs regarding tilde substitution (backported from 9.0). For TCLLIBPATH, do the same tilde substitution as done for TCLx.y_TM_PATH (backported from 9.0 too)
1 parent e5d1b8b commit ab3a945

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

doc/tclvars.n

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ the parent directory of \fBtcl_library\fR,
3131
the directories listed in the \fBtcl_pkgPath\fR variable.
3232
Additional locations to look for files and package indices should
3333
normally be added to this variable using \fBlappend\fR.
34+
Initialization of auto_path from the TCLLIBPATH environment
35+
variable undergoes tilde substitution (see \fBfilename\fR) on each
36+
path. Any tilde substitution that fails because the user is unknown
37+
will be omitted from auto_path.
3438
.RS
3539
.PP
3640
Additional variables relating to package management exist. More

doc/tm.n

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,10 @@ environment variables:
300300
\fB$::env(TCL8.1_TM_PATH)\fR \fB$::env(TCL8_1_TM_PATH)\fR
301301
\fB$::env(TCL8.0_TM_PATH)\fR \fB$::env(TCL8_0_TM_PATH)\fR
302302
.CE
303+
.PP
304+
Paths initialized from the environment variables undergo tilde
305+
substitution (see \fBfilename\fR). Any path whose tilde substitution
306+
fails because the user is unknown will be omitted from search paths.
303307
.SH "SEE ALSO"
304308
package(n), Tcl Improvement Proposal #189
305309
.QW "\fITcl Modules\fR"

library/init.tcl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,15 @@ package require -exact tcl 8.7b1
4343

4444
if {![info exists auto_path]} {
4545
if {[info exists env(TCLLIBPATH)] && (![interp issafe])} {
46-
set auto_path $env(TCLLIBPATH)
46+
set auto_path [apply {{} {
47+
lmap path $::env(TCLLIBPATH) {
48+
# Paths relative to unresolvable home dirs are ignored
49+
if {[catch {file tildeexpand $path} expanded_path]} {
50+
continue
51+
}
52+
set expanded_path
53+
}
54+
}}]
4755
} else {
4856
set auto_path ""
4957
}

0 commit comments

Comments
 (0)