diff options
| author | dkf <donal.k.fellows@manchester.ac.uk> | 2024-08-06 11:12:47 (GMT) |
|---|---|---|
| committer | dkf <donal.k.fellows@manchester.ac.uk> | 2024-08-06 11:12:47 (GMT) |
| commit | 6c41478f2cdcbefeae9c340e1ba2bc9d8d51d47d (patch) | |
| tree | 10b477c4f96989d84a5453310c9715aaef2b3413 /library/safe.tcl | |
| parent | 351ab9f3bf86ea2d971416a759964c836e91c1b9 (diff) | |
| parent | e92ac699c1a4fc8683a61f855f5250c72d12b1c1 (diff) | |
| download | tcl-6c41478f2cdcbefeae9c340e1ba2bc9d8d51d47d.zip tcl-6c41478f2cdcbefeae9c340e1ba2bc9d8d51d47d.tar.gz tcl-6c41478f2cdcbefeae9c340e1ba2bc9d8d51d47d.tar.bz2 | |
merge 8.6
Diffstat (limited to 'library/safe.tcl')
| -rw-r--r-- | library/safe.tcl | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/library/safe.tcl b/library/safe.tcl index 71c1e67..7a8fcdb 100644 --- a/library/safe.tcl +++ b/library/safe.tcl @@ -376,7 +376,7 @@ proc ::safe::InterpSetConfig {child access_path staticsok nestedok deletehook} { # Prevent the addition of dirs on the tm list to the # result if they are already known. if {[dict exists $remap_access_path $dir]} { - if {$firstpass} { + if {$firstpass} { # $dir is in [::tcl::tm::list] and belongs in the slave_tm_path. # Later passes handle subdirectories, which belong in the # access path but not in the module path. @@ -596,9 +596,9 @@ proc ::safe::interpDelete {child} { # Safe Base sub-interpreter, so each one is deleted cleanly and not by # the automatic mechanism built into [interp delete]. foreach sub [interp children $child] { - if {[info exists ::safe::[VarName [list $child $sub]]]} { - ::safe::interpDelete [list $child $sub] - } + if {[info exists ::safe::[VarName [list $child $sub]]]} { + ::safe::interpDelete [list $child $sub] + } } # If the child has a cleanup hook registered, call it. Check the @@ -991,6 +991,10 @@ proc ::safe::AliasSource {child args} { ::interp eval $child [list info script $file] } msg opt] if {$code == 0} { + # See [Bug 1d26e580cf] + if {[string index $contents 0] eq "\uFEFF"} { + set contents [string range $contents 1 end] + } set code [catch {::interp eval $child $contents} msg opt] set replacementMsg $msg } @@ -1192,14 +1196,14 @@ proc ::safe::AliasExeName {child} { proc ::safe::RejectExcessColons {child} { set stripped [regsub -all -- {:::*} $child ::] if {[string range $stripped end-1 end] eq {::}} { - return -code error {interpreter name must not end in "::"} + return -code error {interpreter name must not end in "::"} } if {$stripped ne $child} { - set msg {interpreter name has excess colons in namespace separators} - return -code error $msg + set msg {interpreter name has excess colons in namespace separators} + return -code error $msg } if {[string range $stripped 0 1] eq {::}} { - return -code error {interpreter name must not begin "::"} + return -code error {interpreter name must not begin "::"} } return } |
