diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-06-13 12:00:18 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-06-13 12:00:18 (GMT) |
| commit | d9a71f65449a73b80d7cde60cb934cb15f16b3fe (patch) | |
| tree | 1424195872ed48cba8537a8d0b07f5d3e1085f9d | |
| parent | 1a6455365733889437d189f4ecf6c38626c2118f (diff) | |
| parent | 8d2dcbe6dc47cc961266eabaa352ee5474eebce3 (diff) | |
| download | tcl-d9a71f65449a73b80d7cde60cb934cb15f16b3fe.zip tcl-d9a71f65449a73b80d7cde60cb934cb15f16b3fe.tar.gz tcl-d9a71f65449a73b80d7cde60cb934cb15f16b3fe.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 97139f7..a574a02 100644 --- a/library/safe.tcl +++ b/library/safe.tcl @@ -1082,6 +1082,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 } |
