diff options
| author | fukachan <fukachan> | 2001-02-05 02:06:46 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-02-05 02:06:46 +0000 |
| commit | d297784ed64134ba10c1c9e736d15a97be8fab87 (patch) | |
| tree | 3183e85b023be5de80d516ca9e06ac05a39623eb /fml/lib | |
| parent | cb2fbf75206df5650cf95097c848bc793606c7ab (diff) | |
| download | fml8-d297784ed64134ba10c1c9e736d15a97be8fab87.tar.gz fml8-d297784ed64134ba10c1c9e736d15a97be8fab87.tar.bz2 fml8-d297784ed64134ba10c1c9e736d15a97be8fab87.zip | |
fix position speculation in not multipart case
Diffstat (limited to 'fml/lib')
| -rw-r--r-- | fml/lib/MailingList/Messages.pm | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/fml/lib/MailingList/Messages.pm b/fml/lib/MailingList/Messages.pm index be926b9a..fd375695 100644 --- a/fml/lib/MailingList/Messages.pm +++ b/fml/lib/MailingList/Messages.pm @@ -618,10 +618,19 @@ sub get_content_header sub get_content_body { my ($self, $size) = @_; - my $content = $self->{ content }; - my $pos = index($$content, "\n\n", $self->{ offset_begin }); - my $pos_begin = $pos + 2; - my $msglen = $self->{ offset_end } - $pos_begin; + my $content = $self->{ content }; + my $base_content_type = $self->{ base_content_type }; + my ($pos, $pos_begin, $msglen); + + if ($base_content_type =~ /multipart/i) { + $pos = index($$content, "\n\n", $self->{ offset_begin }); + $pos_begin = $pos + 2; + $msglen = $self->{ offset_end } - $pos_begin; + } + else { + $pos_begin = 0; + $msglen = length($$content); + } $size ||= 512; if ($msglen < $size) { $size = $msglen;} |
