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 | 1d7aa776f4f8c61830c3ef915b147505639822ef (patch) | |
| tree | 1424195872ed48cba8537a8d0b07f5d3e1085f9d | |
| parent | 0bcc000f423dd258c0f36b50a0c0d4c29148cf98 (diff) | |
| parent | 83c030fd712c044a0aee152cbdeeeebebf92b580 (diff) | |
| download | tcl-1d7aa776f4f8c61830c3ef915b147505639822ef.zip tcl-1d7aa776f4f8c61830c3ef915b147505639822ef.tar.gz tcl-1d7aa776f4f8c61830c3ef915b147505639822ef.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 } |
