summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-01-05 11:55:56 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-01-05 11:55:56 (GMT)
commit666afa7352118fa5d33a2de889a93a1842806424 (patch)
tree72eac7cc10c5256c66609a08c44196e94e1c5f91 /library
parent5e02396d5e59a51aa2c1e0cc1adf72c84783b268 (diff)
parent45db0256846ed40d1eef23295a881e985a14a4d7 (diff)
downloadtcl-666afa7352118fa5d33a2de889a93a1842806424.zip
tcl-666afa7352118fa5d33a2de889a93a1842806424.tar.gz
tcl-666afa7352118fa5d33a2de889a93a1842806424.tar.bz2
Merge trunk. Improve test-case. Bring back "source -nopkg", but only as undocumented internal helper for ::tcl::Pkg::source.
Diffstat (limited to 'library')
-rw-r--r--library/init.tcl8
-rw-r--r--library/package.tcl2
2 files changed, 3 insertions, 7 deletions
diff --git a/library/init.tcl b/library/init.tcl
index 9101e35..d642f05 100644
--- a/library/init.tcl
+++ b/library/init.tcl
@@ -472,11 +472,7 @@ proc ::tcl::Pkg::source {filename} {
if {[interp issafe]} {
uplevel 1 [list ::source $filename]
} else {
- set f [open $filename]
- fconfigure $f -eofchar \032
- set contents [read $f]
- close $f
- uplevel 1 [list eval $contents]
+ uplevel 1 [list ::source -nopkg $filename]
}
}
@@ -522,7 +518,7 @@ proc auto_load_index {} {
}
set name [lindex $line 0]
set auto_index($name) \
- "source [file join $dir [lindex $line 1]]"
+ "::tcl::Pkg::source [file join $dir [lindex $line 1]]"
}
} else {
error "[file join $dir tclIndex] isn't a proper Tcl index file"
diff --git a/library/package.tcl b/library/package.tcl
index 1cb2d3d..5257cd6 100644
--- a/library/package.tcl
+++ b/library/package.tcl
@@ -506,7 +506,7 @@ proc tclPkgUnknown {name args} {
# safe interps usually don't have "file exists",
if {([interp issafe] || [file exists $file])} {
try {
- source $file
+ ::tcl::Pkg::source $file
} trap {POSIX EACCES} {} {
# $file was not readable; silently ignore
continue