Subject: | [PATCH] Fix problem with multiple-line output |
Hi,
In _process_cmd(), when the IMAP server returns multiple-line output, the _cmd_ok() method returns undef, causing the while loop to be re-executed. But since the first evaluation of this return value is a '==', this results in the following warning:
--cut--
Use of uninitialized value in numeric eq (==) at /usr/local/lib/perl5/site_perl/5.8.5/Net/IMAP/Simple.pm line 508.
--cut--
The attached patch avoids this.
/Lars
--- /usr/local/lib/perl5/site_perl/5.8.5/Net/IMAP/Simple.pm.orig Fri Dec 31 00:30:08 2004
+++ /usr/local/lib/perl5/site_perl/5.8.5/Net/IMAP/Simple.pm Fri Dec 31 00:36:26 2004
@@ -505,7 +505,7 @@
my $res;
while ( $res = $sock->getline ) {
my $ok = $self->_cmd_ok($res);
- if ( $ok == 1 ) {
+ if ( defined($ok) && $ok == 1 ) {
return $args{final}->($res);
} elsif ( defined($ok) && ! $ok ) {
return;