summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2012-08-19 23:14:52 +0200
committerDaniel Friesel <derf@finalrewind.org>2012-08-19 23:14:52 +0200
commitc3ba72a8a3e0bcaae29e6430279381811299bf37 (patch)
tree8136b3d5e77a501be35151fc68756206c9d57c90
parent29732df1f3bb783875ea4c6939ec38d940f85f65 (diff)
pretty-print read size 0 as 'infinite'
-rw-r--r--lib/App/Hashl.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/App/Hashl.pm b/lib/App/Hashl.pm
index f17f771..f0a93ce 100644
--- a/lib/App/Hashl.pm
+++ b/lib/App/Hashl.pm
@@ -40,6 +40,10 @@ sub si_size {
my ( $self, $bytes ) = @_;
my @post = ( q{ }, qw(k M G T) );
+ if ($bytes == 0) {
+ return 'infinite';
+ }
+
while ( $bytes >= 1024 ) {
$bytes /= 1024;
shift @post;