summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-06-13 10:52:02 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-06-13 10:52:02 (GMT)
commit7565f6665d75cbfcb698aa506bb585f4d3e4fe59 (patch)
treea3b8b13ee53e1e2311da22c0e4c38945661e2874
parent4dad6a40586ac4c41fa501687980e22341350e3d (diff)
parent01b9481840f5c834a5ea2581400bdf78ae2eb9b2 (diff)
downloadtcl-7565f6665d75cbfcb698aa506bb585f4d3e4fe59.zip
tcl-7565f6665d75cbfcb698aa506bb585f4d3e4fe59.tar.gz
tcl-7565f6665d75cbfcb698aa506bb585f4d3e4fe59.tar.bz2
Fix [1d26e580cf]: safe interp can't source files with BOM
-rw-r--r--library/safe.tcl4
1 files changed, 4 insertions, 0 deletions
diff --git a/library/safe.tcl b/library/safe.tcl
index e7044f8..7a8fcdb 100644
--- a/library/safe.tcl
+++ b/library/safe.tcl
@@ -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
}