Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Email-Simple CPAN distribution.

Report information
The Basics
Id: 25496
Status: resolved
Priority: 0/
Queue: Email-Simple

People
Owner: Nobody in particular
Requestors: nicholas [...] oxhoej.dk
Cc:
AdminCc:

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



Subject: Bug in Email::Simple::Header::header_set
Date: Fri, 16 Mar 2007 14:30:23 +0100
To: bug-Email-Simple [...] rt.cpan.org
From: Nicholas Oxhøj <nicholas [...] oxhoej.dk>
Hi There seems to be a bug in Email::Simple::Header version 1.997_02 Line 231 (which comes into play when deleting headers) reads splice @{$headers}, $_, 2 for reverse @indices[ -$overage, $#indices ]; which seems to be completely wrong. It always gets exactly TWO indices (possibly the same one repeated) no matter what $overage is. I think it should instead read something like splice @{$headers}, $_, 2 for reverse @indices[ -$overage..-1 ]; instead... Regards Nicholas Oxhøj
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #25496] Bug in Email::Simple::Header::header_set
Date: Fri, 16 Mar 2007 19:28:55 -0400
To: "nicholas [...] oxhoej.dk via RT" <bug-Email-Simple [...] rt.cpan.org>
From: Ricardo SIGNES <rjbs [...] manxome.org>
* "nicholas@oxhoej.dk via RT" <bug-Email-Simple@rt.cpan.org> [2007-03-16T19:20:27] Show quoted text
> Line 231 (which comes into play when deleting headers) reads > > splice @{$headers}, $_, 2 for reverse @indices[ -$overage, $#indices ]; > > which seems to be completely wrong. It always gets exactly TWO indices
Thanks. I'll try to get to this ASAP. A failing test that demonstrates the problem would be fantastic. -- rjbs
Subject: Re: [rt.cpan.org #25496] Bug in Email::Simple::Header::header_set
Date: Sat, 17 Mar 2007 22:12:23 +0100 (CET)
To: bug-Email-Simple [...] rt.cpan.org
From: nicholas [...] oxhoej.dk
Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=25496 > > > * "nicholas@oxhoej.dk via RT" <bug-Email-Simple@rt.cpan.org> > [2007-03-16T19:20:27]
>> Line 231 (which comes into play when deleting headers) reads >> >> splice @{$headers}, $_, 2 for reverse @indices[ -$overage, $#indices >> ]; >> >> which seems to be completely wrong. It always gets exactly TWO indices
> > Thanks. I'll try to get to this ASAP. A failing test that demonstrates > the > problem would be fantastic.
Well, it is by accident and pure "luck" that your exisiting "deletion" test in header-many.t with $email->header_set(alpha => 'one is the loneliest header'); doesn't fail. To not disturb the rest of the tests, you could probably just add a new test at the very end of that file, deleting e.g. the Bravo header. Something along the lines of $email->header_set(Bravo); is_deeply( [ $email->header_pairs ], [ Alpha => 'header one', Gamma => 'gammalon', alpha => 'header omega', ], "Bravo header gets completely removed", );
Thanks very much. Clearly I had meant to write what you suggested, and my mistake got through because of the unlucky test! I've incorporated your change and the test. I will make a new release today. -- rjbs