From: Jeff Hobbs Date: Wed, 23 Jan 2002 01:58:21 +0000 (+0000) Subject: * tkcon.tcl (dir): prevented possible 'divide by zero' error. X-Git-Tag: tkcon-2-4~35 X-Git-Url: http://privyetmir.co.uk/gitweb?a=commitdiff_plain;h=2978da2ddfd52bb143b0855b8b5da91e50eb5bf6;p=tkcon * tkcon.tcl (dir): prevented possible 'divide by zero' error. [Bug #496584] --- diff --git a/ChangeLog b/ChangeLog index 9034187..4b6f2ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-01-22 Jeff Hobbs + + * tkcon.tcl (dir): prevented possible 'divide by zero' error. + [Bug #496584] + 2001-12-14 Jeff Hobbs * tkcon.tcl: 'tkcon show' causes loss of focus on Windows, so an diff --git a/tkcon.tcl b/tkcon.tcl index 449f7fa..04bfdcb 100755 --- a/tkcon.tcl +++ b/tkcon.tcl @@ -3810,7 +3810,9 @@ proc dir {args} { } } append res [format "%-${i}s" $f] - if {[incr k]%$j == 0} {set res [string trimright $res]\n} + if {$j == 0 || [incr k]%$j == 0} { + set res [string trimright $res]\n + } } append res \n\n }