summaryrefslogtreecommitdiff
path: root/lib/diff.tcl
diff options
context:
space:
mode:
authorLibravatar Shawn O. Pearce <spearce@spearce.org>2007-07-17 01:50:10 -0400
committerLibravatar Shawn O. Pearce <spearce@spearce.org>2007-07-17 01:50:10 -0400
commit6eb420ef61317b2efa2993868a6302afed6ae60a (patch)
tree541e028be7e8c85d4236f9fff05d8c4b73a17533 /lib/diff.tcl
parentgit-gui: Brown paper bag "dirty git version fix" (diff)
downloadtgif-6eb420ef61317b2efa2993868a6302afed6ae60a.tar.xz
git-gui: Always disable the Tcl EOF character when reading
On Windows (which includes Cygwin) Tcl defaults to leaving the EOF character of input file streams set to the ASCII EOF character, but if that character were to appear in the data stream then Tcl will close the channel early. So we have to disable eofchar on Windows. Since the default is disabled on all platforms except Windows, we can just disable it everywhere to prevent any sort of read problem. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'lib/diff.tcl')
-rw-r--r--lib/diff.tcl1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/diff.tcl b/lib/diff.tcl
index 9cb9d0604a..e09e1257e1 100644
--- a/lib/diff.tcl
+++ b/lib/diff.tcl
@@ -86,6 +86,7 @@ proc show_diff {path w {lno {}}} {
set max_sz [expr {128 * 1024}]
if {[catch {
set fd [open $path r]
+ fconfigure $fd -eofchar {}
set content [read $fd $max_sz]
close $fd
set sz [file size $path]