diff options
author | mbr <mbr@FreeBSD.org> | 2004-09-03 06:28:46 +0800 |
---|---|---|
committer | mbr <mbr@FreeBSD.org> | 2004-09-03 06:28:46 +0800 |
commit | c475e261f61a9ab7711d64bc5e1bc616afa64bac (patch) | |
tree | 8f35b3fb4f8c068c87579212181e39840baf448c | |
parent | 6fe7f4a19f703b45e6b514b6cc0f019465a1c481 (diff) | |
download | freebsd-ports-gnome-c475e261f61a9ab7711d64bc5e1bc616afa64bac.tar.gz freebsd-ports-gnome-c475e261f61a9ab7711d64bc5e1bc616afa64bac.tar.zst freebsd-ports-gnome-c475e261f61a9ab7711d64bc5e1bc616afa64bac.zip |
Return undef or the parsed MIME::Entity in parse_data().
Submitted by: David F. Skoll <dfs@roaringpenguin.com>
-rw-r--r-- | mail/p5-MIME-Tools/files/patch-ParserUndef | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/mail/p5-MIME-Tools/files/patch-ParserUndef b/mail/p5-MIME-Tools/files/patch-ParserUndef new file mode 100644 index 000000000000..f79f5bf98a14 --- /dev/null +++ b/mail/p5-MIME-Tools/files/patch-ParserUndef @@ -0,0 +1,43 @@ +--- lib/MIME/Parser.pm Tue Aug 31 18:54:05 2004 ++++ lib/MIME/Parser.pm Tue Aug 31 18:53:33 2004 +@@ -708,6 +710,7 @@ + + ### Parse the next part, and add it to the entity... + my $part = $self->process_part($in, $part_rdr, Retype=>$retype); ++ return undef unless defined($part); + $ent->add_part($part); + + ### ...and look at how we finished up: +@@ -944,6 +954,7 @@ + + ### Parse the message: + my $msg = $self->process_part($in, $rdr); ++ return undef unless defined($msg); + + ### How to handle nested messages? + if ($self->extract_nested_messages eq 'REPLACE') { +@@ -1005,14 +1024,14 @@ + + ### Handle, according to the MIME type: + if ($type eq 'multipart') { +- $self->process_multipart($in, $rdr, $ent); ++ return undef unless defined($self->process_multipart($in, $rdr, $ent)); + } + elsif (("$type/$subtype" eq "message/rfc822" || + "$type/$subtype" eq "message/external-body" || + ("$type/$subtype" eq "message/partial" && $head->mime_attr("content-type.number") == 1)) && + $self->extract_nested_messages) { + $self->debug("attempting to process a nested message"); +- $self->process_message($in, $rdr, $ent); ++ return undef unless defined($self->process_message($in, $rdr, $ent)); + } + else { + $self->process_singlepart($in, $rdr, $ent); +@@ -1080,7 +1080,6 @@ + =back + + Returns the parsed MIME::Entity on success. +-Throws exception on failure. + + =cut + |