summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ec4fcee)
raw | patch | inline | side by side (parent: ec4fcee)
author | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 17 Jul 2007 05:50:10 +0000 (01:50 -0400) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 17 Jul 2007 05:50:10 +0000 (01:50 -0400) |
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>
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>
git-gui.sh | patch | blob | history | |
lib/blame.tcl | patch | blob | history | |
lib/commit.tcl | patch | blob | history | |
lib/diff.tcl | patch | blob | history |
diff --git a/git-gui.sh b/git-gui.sh
index 38084515cba69b1fa1e8c29834f1de562014d44f..d0b75c044c4f0f519ff2f942b1c1b22168c496da 100755 (executable)
--- a/git-gui.sh
+++ b/git-gui.sh
error $err
}
}
+ fconfigure $fd -eofchar {}
return $fd
}
if {[catch {set fd [open $f r]}]} {
return 0
}
+ fconfigure $fd -eofchar {}
set content [string trim [read $fd]]
close $fd
regsub -all -line {[ \r\t]+$} $content {} content
diff --git a/lib/blame.tcl b/lib/blame.tcl
index 4bdb9a27a3dbcc60957f1a4eaed123faf3952bac..1bcb4b471fe0655290beda2133937aff9c314cd0 100644 (file)
--- a/lib/blame.tcl
+++ b/lib/blame.tcl
$w_path conf -text [escape_path $path]
if {$commit eq {}} {
set fd [open $path r]
+ fconfigure $fd -eofchar {}
} else {
set fd [git_read cat-file blob "$commit:$path"]
}
diff --git a/lib/commit.tcl b/lib/commit.tcl
index 46a78c158f53372a481061e9a5a6072c40e54e58..0f3b16dfeb05e4451df3204e94106c0c7b53cbc4 100644 (file)
--- a/lib/commit.tcl
+++ b/lib/commit.tcl
ui_status {Calling pre-commit hook...}
set pch_error {}
set fd_ph [open "| $pchook" r]
- fconfigure $fd_ph -blocking 0 -translation binary
+ fconfigure $fd_ph -blocking 0 -translation binary -eofchar {}
fileevent $fd_ph readable \
[list commit_prehook_wait $fd_ph $curHEAD $msg]
}
diff --git a/lib/diff.tcl b/lib/diff.tcl
index 9cb9d0604a4905337dc0c57d8d846753a3157c8a..e09e1257e1be299caceb0c6f0074c1b43b566974 100644 (file)
--- a/lib/diff.tcl
+++ b/lib/diff.tcl
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]