Fix condition to detect empty output

And remove some whitespace
This commit is contained in:
Florent 2012-03-28 15:05:40 +02:00
commit 90bcdf1054

View file

@ -163,7 +163,7 @@ sub fetch {
my @lines = <$data>; my @lines = <$data>;
close $data or carp "unable to close: $ERRNO"; close $data or carp "unable to close: $ERRNO";
# If error output, print the cache (if exist) and exit # If error output, print the cache (if exist) and exit
if ( @cache_data > 0 ) { if ( @lines == 0 ) {
if ( @cache_data > 0 ) { if ( @cache_data > 0 ) {
print join q{}, @cache_data[ 1 .. $#cache_data ]; print join q{}, @cache_data[ 1 .. $#cache_data ];
exit 0; exit 0;