diff options
author | Daniel Friesel <derf@finalrewind.org> | 2012-08-19 23:14:52 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2012-08-19 23:14:52 +0200 |
commit | c3ba72a8a3e0bcaae29e6430279381811299bf37 (patch) | |
tree | 8136b3d5e77a501be35151fc68756206c9d57c90 /lib/App | |
parent | 29732df1f3bb783875ea4c6939ec38d940f85f65 (diff) |
pretty-print read size 0 as 'infinite'
Diffstat (limited to 'lib/App')
-rw-r--r-- | lib/App/Hashl.pm | 4 |
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; |