summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-01-15 14:58:03 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-01-15 14:58:03 (GMT)
commitdbd3f823aa0643083cc896c944c8188782f84153 (patch)
tree7eb7ca1d7fa306a509316de4d2989c2459716c15 /library
parent78d6e8f34ca33491a8ae054c025f3c8925737e32 (diff)
downloadtcl-dbd3f823aa0643083cc896c944c8188782f84153.zip
tcl-dbd3f823aa0643083cc896c944c8188782f84153.tar.gz
tcl-dbd3f823aa0643083cc896c944c8188782f84153.tar.bz2
Bugfix for TIP #587 implementation: Always use -eofchar "\032 {}" and _NOT_ -eofchar \032, otherwise there's the risk that ^Z is appended too the open channel. See [5bfe3de008], we don't want to open that can of worms again!
Diffstat (limited to 'library')
-rw-r--r--library/auto.tcl4
-rw-r--r--library/init.tcl2
-rw-r--r--library/install.tcl6
-rw-r--r--library/safe.tcl2
4 files changed, 7 insertions, 7 deletions
diff --git a/library/auto.tcl b/library/auto.tcl
index 2eacf8c..5f86c93 100644
--- a/library/auto.tcl
+++ b/library/auto.tcl
@@ -292,7 +292,7 @@ proc auto_mkindex_old {dir args} {
set f ""
set error [catch {
set f [open $file]
- fconfigure $f -encoding utf-8 -eofchar \032
+ fconfigure $f -encoding utf-8 -eofchar "\032 {}"
while {[gets $f line] >= 0} {
if {[regexp {^proc[ ]+([^ ]*)} $line match procName]} {
set procName [lindex [auto_qualify $procName "::"] 0]
@@ -404,7 +404,7 @@ proc auto_mkindex_parser::mkindex {file} {
set scriptFile $file
set fid [open $file]
- fconfigure $fid -encoding utf-8 -eofchar \032
+ fconfigure $fid -encoding utf-8 -eofchar "\032 {}"
set contents [read $fid]
close $fid
diff --git a/library/init.tcl b/library/init.tcl
index c5b9705..c9bfff6 100644
--- a/library/init.tcl
+++ b/library/init.tcl
@@ -442,7 +442,7 @@ proc auto_load_index {} {
continue
} else {
set error [catch {
- fconfigure $f -encoding utf-8 -eofchar \032
+ fconfigure $f -encoding utf-8 -eofchar "\032 {}"
set id [gets $f]
if {$id eq "# Tcl autoload index file, version 2.0"} {
eval [read $f]
diff --git a/library/install.tcl b/library/install.tcl
index 2c5afa7..ce8e80b 100644
--- a/library/install.tcl
+++ b/library/install.tcl
@@ -35,7 +35,7 @@ proc ::practcl::_pkgindex_directory {path} {
# Read the file, and override assumptions as needed
###
set fin [open $file r]
- fconfigure $fin -encoding utf-8 -eofchar \032
+ fconfigure $fin -encoding utf-8 -eofchar "\032 {}"
set dat [read $fin]
close $fin
# Look for a teapot style Package statement
@@ -59,7 +59,7 @@ proc ::practcl::_pkgindex_directory {path} {
foreach file [glob -nocomplain $path/*.tcl] {
if { [file tail $file] == "version_info.tcl" } continue
set fin [open $file r]
- fconfigure $fin -encoding utf-8 -eofchar \032
+ fconfigure $fin -encoding utf-8 -eofchar "\032 {}"
set dat [read $fin]
close $fin
if {![regexp "package provide" $dat]} continue
@@ -79,7 +79,7 @@ proc ::practcl::_pkgindex_directory {path} {
return $buffer
}
set fin [open $pkgidxfile r]
- fconfigure $fin -encoding utf-8 -eofchar \032
+ fconfigure $fin -encoding utf-8 -eofchar "\032 {}"
set dat [read $fin]
close $fin
set trace 0
diff --git a/library/safe.tcl b/library/safe.tcl
index 0efc00f..2ee4531 100644
--- a/library/safe.tcl
+++ b/library/safe.tcl
@@ -980,7 +980,7 @@ proc ::safe::AliasSource {child args} {
set replacementMsg "script error"
set code [catch {
set f [open $realfile]
- fconfigure $f -encoding $encoding -eofchar \032
+ fconfigure $f -encoding $encoding -eofchar "\032 {}"
set contents [read $f]
close $f
::interp eval $child [list info script $file]