On Sun, 14 Jan 2007, Joey Hess wrote:

I tried out 1.5000. I'm still seeing apparently the same hang with it
while building Mail::MboxParser..

Hi Tassilo,

It looks like changes to my module Mail::Mbox::MessageParser are causing
your module Mail::MboxParser to hang during "make test". I debugged the
issue, and it appears to be a problem with the way that you change the
file position while testing the newline type in the file, as well as
another unnecessary seek in next_message_new().

Attached is a patch that fixes the problem(s).

Regards,
David

P.S. Joey, there are still two warnings issued during the "make test" step
of Tassilo's module. These are coming from my module, and will be fixed in
versions > 1.5000.

_____________________________________________________________________
David Coppit                           [EMAIL PROTECTED]
The College of William and Mary        http://coppit.org/

"When the president does it that means that it is not illegal."
- Richard Nixon on domestic surveillance, 5/19/1977
"Do I have the legal authority to do this? And the answer is, absolutely."
- George W. Bush on domestic surveillance, 12/19/2005
--- MboxParser.pm       2005-12-08 05:15:39.000000000 -0500
+++ /Users/coppit/Desktop/MboxParser.pm 2007-04-23 13:54:45.000000000 -0400
@@ -519,7 +519,6 @@
 
     return undef if ref(\$p) eq 'SCALAR' or $p->end_of_file;
 
-    seek $self->{READER}, $self->{CURR_POS}, SEEK_SET;
     my $nl = $self->{NL};
     my $mailref = $p->read_next_email;
     my ($header, $body) = split /$nl$nl/, $$mailref, 2;
@@ -794,6 +793,7 @@
     my $h = $self->{READER};
     my $newline;
     
+               my $old_position = tell $h;
     seek $h, 0, SEEK_SET;
     while (sysread $h, (my $c), 1) {
         if (ord($c) == 13) {
@@ -807,6 +807,7 @@
             last;
         }
     }
+               seek($h, $old_position, 0);
     return $newline;
 }
 

Reply via email to