summaryrefslogtreecommitdiff
path: root/git-gui.sh
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-07-17 05:50:10 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-07-17 05:50:10 (GMT)
commit6eb420ef61317b2efa2993868a6302afed6ae60a (patch)
tree541e028be7e8c85d4236f9fff05d8c4b73a17533 /git-gui.sh
parentec4fceece4a9f155afcadec254caff5cef781c67 (diff)
downloadgit-6eb420ef61317b2efa2993868a6302afed6ae60a.zip
git-6eb420ef61317b2efa2993868a6302afed6ae60a.tar.gz
git-6eb420ef61317b2efa2993868a6302afed6ae60a.tar.bz2
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 'git-gui.sh')
-rwxr-xr-xgit-gui.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/git-gui.sh b/git-gui.sh
index 3808451..d0b75c0 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -414,6 +414,7 @@ proc _open_stdout_stderr {cmd} {
error $err
}
}
+ fconfigure $fd -eofchar {}
return $fd
}
@@ -828,6 +829,7 @@ proc load_message {file} {
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