]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/MIME.pm
- Save leading space when we unmime (closes: #416321)
[debbugs.git] / Debbugs / MIME.pm
index 9099fa1b038d8aaa99ab62bc4fc5150732768cc6..69760002369ce1e1a312f62ac52d2043f3ce71e5 100644 (file)
@@ -210,9 +210,13 @@ sub decode_rfc1522 ($)
 {
     my ($string) = @_;
 
+    # this is craptacular, but leading space is hacked off by unmime.
+    # Save it.
+    my $leading_space = '';
+    $leading_space = $1 if $string =~ s/^(\s+)//;
     # unmime calls the default MIME::WordDecoder handler set up at
     # initialization time.
-    return MIME::WordDecoder::unmime($string);
+    return $leading_space . MIME::WordDecoder::unmime($string);
 }
 
 =head2 encode_rfc1522