avoid progress if there is noting to say
authorHeiko Schlittermann (VIC) <hs@schlittermann.de>
Sun, 24 Jul 2011 22:43:08 +0200
changeset 7 a508df65c738
parent 6 129b39480dc5
child 8 6bc08224c44e
avoid progress if there is noting to say
cleaner
--- a/cleaner	Sun Jul 24 00:51:36 2011 +0200
+++ b/cleaner	Sun Jul 24 22:43:08 2011 +0200
@@ -56,7 +56,8 @@
 	my $done = 0;
 	local $SIG{ALRM} = sub {
 	    say sprintf "done %5.1f%% (%*d of $total)" 
-		=> 100 * $done/$total, length($total), $done;
+		=> 100 * $done/$total, length($total), $done
+		if $total;
 	    alarm 5;
 	};
 	$SIG{ALRM}->();