From c47c440be201796b70e73c246807a534cc3b089e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 16 Jul 2021 06:07:43 +0000 Subject: -eofchar should only be effective on input, not on output, since it could result in CTRL-Z be written when closing the file. (backported from 8.6) --- library/auto.tcl | 4 ++-- library/safe.tcl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/library/auto.tcl b/library/auto.tcl index 1b8ad44..9b6dbf1 100644 --- a/library/auto.tcl +++ b/library/auto.tcl @@ -250,7 +250,7 @@ proc auto_mkindex_old {dir args} { set f "" set error [catch { set f [open $file] - fconfigure $f -eofchar \032 + fconfigure $f -eofchar "\032 {}" while {[gets $f line] >= 0} { if {[regexp {^proc[ ]+([^ ]*)} $line match procName]} { set procName [lindex [auto_qualify $procName "::"] 0] @@ -354,7 +354,7 @@ proc auto_mkindex_parser::mkindex {file} { set scriptFile $file set fid [open $file] - fconfigure $fid -eofchar \032 + fconfigure $fid -eofchar "\032 {}" set contents [read $fid] close $fid diff --git a/library/safe.tcl b/library/safe.tcl index 92cd6d1..bd51e18 100644 --- a/library/safe.tcl +++ b/library/safe.tcl @@ -854,7 +854,7 @@ proc ::safe::AliasSource {slave args} { set old [::interp eval $slave {info script}] set code [catch { set f [open $realfile] - fconfigure $f -eofchar \032 + fconfigure $f -eofchar "\032 {}" if {$encoding ne ""} { fconfigure $f -encoding $encoding } -- cgit v0.12