summaryrefslogtreecommitdiffstats
path: root/library/safe.tcl
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-06-13 12:00:18 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-06-13 12:00:18 (GMT)
commitd9a71f65449a73b80d7cde60cb934cb15f16b3fe (patch)
tree1424195872ed48cba8537a8d0b07f5d3e1085f9d /library/safe.tcl
parent1a6455365733889437d189f4ecf6c38626c2118f (diff)
parent8d2dcbe6dc47cc961266eabaa352ee5474eebce3 (diff)
downloadtcl-d9a71f65449a73b80d7cde60cb934cb15f16b3fe.zip
tcl-d9a71f65449a73b80d7cde60cb934cb15f16b3fe.tar.gz
tcl-d9a71f65449a73b80d7cde60cb934cb15f16b3fe.tar.bz2
Fix [1d26e580cf]: safe interp can't source files with BOM
Diffstat (limited to 'library/safe.tcl')
-rw-r--r--library/safe.tcl4
1 files changed, 4 insertions, 0 deletions
diff --git a/library/safe.tcl b/library/safe.tcl
index 97139f7..a574a02 100644
--- a/library/safe.tcl
+++ b/library/safe.tcl
@@ -1082,6 +1082,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
}