git-gui: fix git-gui crash due to uninitialized variable
authorClemens Buchacher <drizzd@aon.at>
Sat, 21 Jan 2012 17:57:28 +0000 (18:57 +0100)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Sun, 22 Jan 2012 23:16:03 +0000 (23:16 +0000)
Recently, a clone initiated via git gui on Windows crashed on me due to
an "unknown variable cdone". It turns out that there is a code path
where this variable is used uninitialized.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
lib/status_bar.tcl

index 95cb44991fc5b018805d6091c4f98ce7ae0ccf52..02111a1742f92eff7efc6b8e54323919029867bc 100644 (file)
@@ -77,6 +77,7 @@ method start {msg uds} {
 
 method update {have total} {
        set pdone 0
+       set cdone 0
        if {$total > 0} {
                set pdone [expr {100 * $have / $total}]
                set cdone [expr {[winfo width $w_c] * $have / $total}]