Skip Menu |

This queue is for tickets about the Mail-IMAPClient CPAN distribution.

Report information
The Basics
Id: 36726
Status: resolved
Priority: 0/
Queue: Mail-IMAPClient

People
Owner: Nobody in particular
Requestors: jh [...] plonk.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: incorrect append_file() return code
Date: Fri, 13 Jun 2008 17:33:12 +0200
To: bug-Mail-IMAPClient [...] rt.cpan.org
From: Jakob Hirsch <jh [...] plonk.de>
Hi, the man page says, append_file() will return true (or the uid, if supported) for successful appends, but at least versions 3.05 and 3.08 return undef instead. The obvious fix for this is attached. Regards, Jakob
--- IMAPClient.pm 2008-06-13 13:59:57.000000000 +0200 +++ IMAPClient.pm 2008-05-26 13:25:39.000000000 +0200 @@ -2474,7 +2478,7 @@ } $fh->close; - $code ne 'OK' ? undef + $code eq 'OK' ? undef : defined $uid ? $uid : $self; }
Subject: Re: [rt.cpan.org #36726] incorrect append_file() return code
Date: Sat, 14 Jun 2008 13:25:06 +0200
To: Jakob Hirsch via RT <bug-Mail-IMAPClient [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* Jakob Hirsch via RT (bug-Mail-IMAPClient@rt.cpan.org) [080613 15:33]: Show quoted text
> Fri Jun 13 11:33:35 2008: Request 36726 was acted upon. > Transaction: Ticket created by jh@plonk.de > Queue: Mail-IMAPClient > Subject: incorrect append_file() return code > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: jh@plonk.de > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=36726 > > > > the man page says, append_file() will return true (or the uid, if > supported) for successful appends, but at least versions 3.05 and 3.08 > return undef instead. The obvious fix for this is attached.
No, it doesn't. If there is no 'OK', it will return undef. If there is an 'OK', then the UID is returned (if supported), and otherwise some other trueth value being $self. So, I think you patch is not correct, and the existing code is correct. But I may be wrong, convince me! Show quoted text
> --- IMAPClient.pm 2008-06-13 13:59:57.000000000 +0200 > +++ IMAPClient.pm 2008-05-26 13:25:39.000000000 +0200 > @@ -2474,7 +2478,7 @@ > } > $fh->close; > > - $code ne 'OK' ? undef > + $code eq 'OK' ? undef > : defined $uid ? $uid > : $self; > }
-- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #36726] incorrect append_file() return code
Date: Sat, 14 Jun 2008 15:13:59 +0200
To: bug-Mail-IMAPClient [...] rt.cpan.org
From: Jakob Hirsch <jh [...] plonk.de>
Mark Overmeer via RT wrote: Show quoted text
>> the man page says, append_file() will return true (or the uid, if >> supported) for successful appends, but at least versions 3.05 and 3.08 >> return undef instead. The obvious fix for this is attached.
> No, it doesn't. > If there is no 'OK', it will return undef. > If there is an 'OK', then the UID is returned (if supported), and otherwise > some other trueth value being $self.
Oh. I got the files for the diff mixed up. The current code is (starting at line 2481): $code eq 'OK' ? undef : defined $uid ? $uid : $self; Which means: return undef when $code is 'OK'. But it should be: return undef when $code is not 'OK'. Sorry for the confusion...
Subject: Re: [rt.cpan.org #36726] incorrect append_file() return code
Date: Sun, 15 Jun 2008 13:54:34 +0200
To: Jakob Hirsch via RT <bug-Mail-IMAPClient [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* Jakob Hirsch via RT (bug-Mail-IMAPClient@rt.cpan.org) [080614 13:14]: Show quoted text
> Queue: Mail-IMAPClient > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=36726 > > > Oh. I got the files for the diff mixed up. > The current code is (starting at line 2481):
Ah. You're correct now ;-) Accepted for 3.09 -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
fixed in 3.09