diff options
author | kjnash <k.j.nash@usa.net> | 2022-08-31 15:24:20 (GMT) |
---|---|---|
committer | kjnash <k.j.nash@usa.net> | 2022-08-31 15:24:20 (GMT) |
commit | 7443a97bd1d5060c2bc3ea57dbd1899ea2efb9b8 (patch) | |
tree | a7402019faf3e75458552fe9dde90324f981fe7b /library/safe.tcl | |
parent | 19f8c3bb6b2aa8d571a7534b588ddacfb49952d3 (diff) | |
parent | 52b58d0c7d1575d7c784ccb344862e0de8a9686b (diff) | |
download | tcl-7443a97bd1d5060c2bc3ea57dbd1899ea2efb9b8.zip tcl-7443a97bd1d5060c2bc3ea57dbd1899ea2efb9b8.tar.gz tcl-7443a97bd1d5060c2bc3ea57dbd1899ea2efb9b8.tar.bz2 |
Merge old 8.7 6c69a72c58
Diffstat (limited to 'library/safe.tcl')
-rw-r--r-- | library/safe.tcl | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/library/safe.tcl b/library/safe.tcl index 4b1f5ca..4982497 100644 --- a/library/safe.tcl +++ b/library/safe.tcl @@ -1081,7 +1081,7 @@ proc ::safe::AliasSource {child args} { set replacementMsg "script error" set code [catch { set f [open $realfile] - fconfigure $f -encoding $encoding -eofchar \032 + fconfigure $f -encoding $encoding -eofchar "\032 {}" set contents [read $f] close $f ::interp eval $child [list info script $file] @@ -1110,8 +1110,8 @@ proc ::safe::AliasLoad {child file args} { return -code error $msg } - # package name (can be empty if file is not). - set package [lindex $args 0] + # prefix (can be empty if file is not). + set prefix [lindex $args 0] namespace upvar ::safe [VarName $child] state @@ -1123,23 +1123,23 @@ proc ::safe::AliasLoad {child file args} { # authorize that. if {!$state(nestedok)} { Log $child "loading to a sub interp (nestedok)\ - disabled (trying to load $package to $target)" + disabled (trying to load $prefix to $target)" return -code error "permission denied (nested load)" } } # Determine what kind of load is requested if {$file eq ""} { - # static package loading - if {$package eq ""} { - set msg "load error: empty filename and no package name" + # static loading + if {$prefix eq ""} { + set msg "load error: empty filename and no prefix" Log $child $msg return -code error $msg } if {!$state(staticsok)} { - Log $child "static packages loading disabled\ - (trying to load $package to $target)" - return -code error "permission denied (static package)" + Log $child "static loading disabled\ + (trying to load $prefix to $target)" + return -code error "permission denied (static library)" } } else { # file loading @@ -1162,10 +1162,10 @@ proc ::safe::AliasLoad {child file args} { } try { - return [::interp invokehidden $child load $file $package $target] + return [::interp invokehidden $child load $file $prefix $target] } on error msg { - # Some packages return no error message. - set msg0 "load of binary library for package $package failed" + # Some libraries return no error message. + set msg0 "load of library for prefix $prefix failed" if {$msg eq {}} { set msg $msg0 } else { |