summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-06-12 12:10:50 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-06-12 12:10:50 (GMT)
commitaacd5eef2d2bf6b7d03aad0941282762e8957566 (patch)
tree1e84a2001d94ae36cbd3ea783a459cdcf462dfda /library
parentf6f180df58c8c736937a105dbb2cdac6755f7c13 (diff)
downloadtcl-aacd5eef2d2bf6b7d03aad0941282762e8957566.zip
tcl-aacd5eef2d2bf6b7d03aad0941282762e8957566.tar.gz
tcl-aacd5eef2d2bf6b7d03aad0941282762e8957566.tar.bz2
Fix [1d26e580cf]: safe interp can't source files with BOM.
(init.tcl has a BOM now, for testing purposes. Don't merge this to core-8-6-branch!)
Diffstat (limited to 'library')
-rw-r--r--library/init.tcl2
-rw-r--r--library/safe.tcl4
2 files changed, 5 insertions, 1 deletions
diff --git a/library/init.tcl b/library/init.tcl
index a6745ab..81e6243 100644
--- a/library/init.tcl
+++ b/library/init.tcl
@@ -1,4 +1,4 @@
-# init.tcl --
+# init.tcl --
#
# Default system startup file for Tcl-based applications. Defines
# "unknown" procedure and auto-load facilities.
diff --git a/library/safe.tcl b/library/safe.tcl
index 71c1e67..9c605f2 100644
--- a/library/safe.tcl
+++ b/library/safe.tcl
@@ -987,6 +987,10 @@ proc ::safe::AliasSource {child args} {
fconfigure $f -encoding $encoding
}
set contents [read $f]
+ # See [Bug 1d26e580cf]
+ if {[string index $contents 0] eq "\uFEFF"} {
+ set contents [string range $contents 1 end]
+ }
close $f
::interp eval $child [list info script $file]
} msg opt]