summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-06-13 10:53:08 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-06-13 10:53:08 (GMT)
commite5dcec2042f97d68b2c6424fc4fe35f388132b93 (patch)
tree3a1b27905faf9399188a945fb60cdac8bf4d0cd3
parenta470962721d86614961f353054a09483795537b7 (diff)
parentc43c3f788df296e14efb6dc42d13ca3136e00bcf (diff)
downloadtcl-e5dcec2042f97d68b2c6424fc4fe35f388132b93.zip
tcl-e5dcec2042f97d68b2c6424fc4fe35f388132b93.tar.gz
tcl-e5dcec2042f97d68b2c6424fc4fe35f388132b93.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 969abda..6f06dc7 100644
--- a/library/safe.tcl
+++ b/library/safe.tcl
@@ -1087,6 +1087,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
}