From: ivan Date: Fri, 8 Dec 2000 02:57:05 +0000 (+0000) Subject: sub size: regex incorrectly assumes whitespace X-Git-Tag: Net_SCP_0_02~1 X-Git-Url: http://git.freeside.biz/gitweb/?p=Net-SCP.git;a=commitdiff_plain;h=aa6d6c889e19664fd73daac1d60aeb544faf3015 sub size: regex incorrectly assumes whitespace --- diff --git a/SCP.pm b/SCP.pm index 6a25ccd..f0fd8ea 100644 --- a/SCP.pm +++ b/SCP.pm @@ -237,7 +237,7 @@ sub size { 0; } else { chomp( my $size = <$reader> || 0 ); - if ( $size =~ /^\s+(\d+)/ ) { + if ( $size =~ /^\s*(\d+)/ ) { $1 ? $1 : '0e0'; } else { $self->{errstr} = "unparsable output from remote wc: $size"; @@ -278,6 +278,8 @@ sub binary { 1; } Ivan Kohler Anthony Deaver +Thanks to Jon Gunnip for fixing a bug with size(). + =head1 BUGS Still has no-OO cruft.