diff options
Diffstat (limited to 'library/init.tcl')
-rw-r--r-- | library/init.tcl | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/library/init.tcl b/library/init.tcl index e3d4ef0..9101e35 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -46,8 +46,6 @@ if {![info exists auto_path]} { } } -source [file join $::tcl_library auto.tcl] - namespace eval tcl { variable Dir foreach Dir [list $::tcl_library [file dirname $::tcl_library]] { @@ -115,6 +113,8 @@ namespace eval tcl { } } +namespace eval tcl::Pkg {} + # Windows specific end of initialization if {(![interp issafe]) && ($tcl_platform(platform) eq "windows")} { @@ -460,6 +460,26 @@ proc auto_load {cmd {namespace {}}} { return 0 } +# ::tcl::Pkg::source -- +# This procedure provides an alternative "source" command, which doesn't +# register the file for the "package files" command. Safe interpreters +# don't have to do anything special. +# +# Arguments: +# filename + +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] + } +} + # auto_load_index -- # Loads the contents of tclIndex files on the auto_path directory # list. This is usually invoked within auto_load to load the index |