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)
commitc43c3f788df296e14efb6dc42d13ca3136e00bcf (patch)
treea3b8b13ee53e1e2311da22c0e4c38945661e2874
parent5164ba1fe94c156c0477e09dbcdf506032cedee3 (diff)
parentf556fbe0527f88ac03ab5a132a38cf2a6d1accd4 (diff)
downloadtcl-c43c3f788df296e14efb6dc42d13ca3136e00bcf.zip
tcl-c43c3f788df296e14efb6dc42d13ca3136e00bcf.tar.gz
tcl-c43c3f788df296e14efb6dc42d13ca3136e00bcf.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
}