diff options
author | sebres <sebres@users.sourceforge.net> | 2017-03-06 20:18:35 (GMT) |
---|---|---|
committer | sebres <sebres@users.sourceforge.net> | 2017-03-06 20:18:35 (GMT) |
commit | 9f13ce8038e4c27cab5d0ee977a61ca48bde2b73 (patch) | |
tree | 2c581478c211e56c314bcaaeef4a690e7da31ed7 /library/init.tcl | |
parent | c88fb138612db4499a9e841453cd14bfd5db7224 (diff) | |
parent | ae0c48521551ffe6af28967e0c3b848836fb632e (diff) | |
download | tcl-9f13ce8038e4c27cab5d0ee977a61ca48bde2b73.zip tcl-9f13ce8038e4c27cab5d0ee977a61ca48bde2b73.tar.gz tcl-9f13ce8038e4c27cab5d0ee977a61ca48bde2b73.tar.bz2 |
merge trunk
Diffstat (limited to 'library/init.tcl')
-rw-r--r-- | library/init.tcl | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/library/init.tcl b/library/init.tcl index 544ea77..fac1722 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -45,6 +45,7 @@ if {![info exists auto_path]} { set auto_path "" } } + namespace eval tcl { variable Dir foreach Dir [list $::tcl_library [file dirname $::tcl_library]] { @@ -112,6 +113,8 @@ namespace eval tcl { } } +namespace eval tcl::Pkg {} + # Windows specific end of initialization if {(![interp issafe]) && ($tcl_platform(platform) eq "windows")} { @@ -457,6 +460,22 @@ 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 { + uplevel 1 [list ::source -nopkg $filename] + } +} + # 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 @@ -499,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" @@ -636,8 +655,9 @@ proc auto_execok name { } set auto_execs($name) "" - set shellBuiltins [list cls copy date del dir echo erase md mkdir \ - mklink rd ren rename rmdir start time type ver vol] + set shellBuiltins [list assoc cls copy date del dir echo erase ftype \ + md mkdir mklink move rd ren rename rmdir start \ + time type ver vol] if {[info exists env(PATHEXT)]} { # Add an initial ; to have the {} extension check first. set execExtensions [split ";$env(PATHEXT)" ";"] |