summaryrefslogtreecommitdiff
path: root/git-gui
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2006-11-19 06:00:48 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2006-11-19 06:00:48 (GMT)
commit86291555c94300b057a156d87239a6cab09511b3 (patch)
tree241735d506d63f6868b477b4b33f01bf3792b264 /git-gui
parentdde5974ef109ed3aadfbac4d233899fb04d1c9ff (diff)
downloadgit-86291555c94300b057a156d87239a6cab09511b3.zip
git-86291555c94300b057a156d87239a6cab09511b3.tar.gz
git-86291555c94300b057a156d87239a6cab09511b3.tar.bz2
git-gui: Fix list loading corruption introduced by 1461c5f3.
Tcl let me assign two different types of values to the variable $n. Prior to 1461c5f3 $n was the total number of bytes in the string; but in that commit it also became the current info list for the current file. This caused $c < $n to fail as $n was now treated as 0 and we only loaded the first file in each buffer. So use a different variable, like $i, instead. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'git-gui')
-rwxr-xr-xgit-gui14
1 files changed, 8 insertions, 6 deletions
diff --git a/git-gui b/git-gui
index 7ea31e5..bd22125 100755
--- a/git-gui
+++ b/git-gui
@@ -369,13 +369,14 @@ proc read_diff_index {fd after} {
if {$z2 == -1} break
incr c
- set n [split [string range $buf_rdi $c [expr {$z1 - 2}]] { }]
+ set i [split [string range $buf_rdi $c [expr {$z1 - 2}]] { }]
merge_state \
[string range $buf_rdi $z1 [expr {$z2 - 1}]] \
- [lindex $n 4]? \
- [list [lindex $n 0] [lindex $n 2]] \
+ [lindex $i 4]? \
+ [list [lindex $i 0] [lindex $i 2]] \
[list]
set c $z2
+ incr c
}
if {$c < $n} {
set buf_rdi [string range $buf_rdi $c end]
@@ -400,13 +401,14 @@ proc read_diff_files {fd after} {
if {$z2 == -1} break
incr c
- set n [split [string range $buf_rdf $c [expr {$z1 - 2}]] { }]
+ set i [split [string range $buf_rdf $c [expr {$z1 - 2}]] { }]
merge_state \
[string range $buf_rdf $z1 [expr {$z2 - 1}]] \
- ?[lindex $n 4] \
+ ?[lindex $i 4] \
[list] \
- [list [lindex $n 0] [lindex $n 2]]
+ [list [lindex $i 0] [lindex $i 2]]
set c $z2
+ incr c
}
if {$c < $n} {
set buf_rdf [string range $buf_rdf $c end]