* tkcon.tcl (dir): prevented possible 'divide by zero' error.
authorJeff Hobbs <hobbs@users.sourceforge.net>
Wed, 23 Jan 2002 01:58:21 +0000 (01:58 +0000)
committerJeff Hobbs <hobbs@users.sourceforge.net>
Wed, 23 Jan 2002 01:58:21 +0000 (01:58 +0000)
[Bug #496584]

ChangeLog
tkcon.tcl

index 903418722561055ec8a96bf8803deb681146c23e..4b6f2ecca875b3237fa955d5fa1524a801ba76c3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-01-22  Jeff Hobbs  <jeffh@ActiveState.com>
+
+       * tkcon.tcl (dir): prevented possible 'divide by zero' error.
+       [Bug #496584]
+
 2001-12-14  Jeff Hobbs  <jeffh@ActiveState.com>
 
        * tkcon.tcl: 'tkcon show' causes loss of focus on Windows, so an
index 449f7fa93263e78987389ff7f86f8b09ff52d587..04bfdcb59cb04c24552dc404b478c401a0e5aed9 100755 (executable)
--- 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
        }