]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/MIME.pm
merge changes from don
[debbugs.git] / Debbugs / MIME.pm
index 59ffda489b47c282d5c23d850177e07f1501b434..785997477ce9a3e2af44051f6a76595d02e61155 100644 (file)
@@ -56,12 +56,12 @@ sub getmailbody
     return undef;
 }
 
-sub parse ($)
+sub parse
 {
     # header and decoded body respectively
     my (@headerlines, @bodylines);
 
-    my $parser = new MIME::Parser;
+    my $parser = MIME::Parser->new();
     mkdir "mime.tmp.$$", 0777;
     $parser->output_under("mime.tmp.$$");
     my $entity = eval { $parser->parse_data($_[0]) };
@@ -215,8 +215,7 @@ BEGIN {
        ]));
 }
 
-sub decode_rfc1522 ($)
-{
+sub decode_rfc1522 {
     my ($string) = @_;
 
     # this is craptacular, but leading space is hacked off by unmime.
@@ -240,9 +239,11 @@ MIME::Words::encode_mimeword on distinct words as appropriate.
 # We cannot use MIME::Words::encode_mimewords because that function
 # does not handle spaces properly at all.
 
-sub encode_rfc1522 ($) {
+sub encode_rfc1522 {
      my ($rawstr) = @_;
 
+     # handle being passed undef properly
+     return undef if not defined $rawstr;
      # We process words in reverse so we can preserve spacing between
      # encoded words. This regex splits on word|nonword boundaries and
      # nonword|nonword boundaries.