Skip to content

Commit d121b99

Browse files
author
jan.nijtmans
committed
Fix [1d26e580cf]: safe interp can't source files with BOM
2 parents e80a964 + e4a0bd4 commit d121b99

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

library/safe.tcl

+4
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,10 @@ proc ::safe::AliasSource {child args} {
991991
::interp eval $child [list info script $file]
992992
} msg opt]
993993
if {$code == 0} {
994+
# See [Bug 1d26e580cf]
995+
if {[string index $contents 0] eq "\uFEFF"} {
996+
set contents [string range $contents 1 end]
997+
}
994998
set code [catch {::interp eval $child $contents} msg opt]
995999
set replacementMsg $msg
9961000
}

0 commit comments

Comments
 (0)