diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-06-13 10:53:08 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-06-13 10:53:08 (GMT) |
| commit | e5dcec2042f97d68b2c6424fc4fe35f388132b93 (patch) | |
| tree | 3a1b27905faf9399188a945fb60cdac8bf4d0cd3 | |
| parent | a470962721d86614961f353054a09483795537b7 (diff) | |
| parent | c43c3f788df296e14efb6dc42d13ca3136e00bcf (diff) | |
| download | tcl-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.tcl | 4 |
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 } |
