about summary refs log tree commit homepage
path: root/lib/PublicInbox
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-01-25 02:47:08 +0000
committerEric Wong <e@yhbt.net>2020-01-25 09:00:39 +0000
commit0cf1c8b305e15d9ca9869c624a71c96b96a7a5cc (patch)
tree72a4e119bc31b1245ac7034a1825448cd78b7321 /lib/PublicInbox
parent2a56039ff6a6a8d0b04437b5463c172ecab002c5 (diff)
downloadpublic-inbox-0cf1c8b305e15d9ca9869c624a71c96b96a7a5cc.tar.gz
We can't pass empty strings to `to_filename' without
triggering warnings, and `to_filename' on an empty string
makes no sense.
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r--lib/PublicInbox/Mbox.pm5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/PublicInbox/Mbox.pm b/lib/PublicInbox/Mbox.pm
index 1f9ac6ec..cf93e7db 100644
--- a/lib/PublicInbox/Mbox.pm
+++ b/lib/PublicInbox/Mbox.pm
@@ -24,11 +24,10 @@ sub subject_fn ($) {
         # no need for full Email::MIME, here
         if ($fn =~ /=\?/) {
                 eval { $fn = Encode::decode('MIME-Header', $fn) };
-                $fn = 'no-subject' if $@;
+                return 'no-subject' if $@;
         }
         $fn =~ s/^re:\s+//i;
-        $fn = to_filename($fn);
-        $fn eq '' ? 'no-subject' : $fn;
+        $fn eq '' ? 'no-subject' : to_filename($fn);
 }
 
 sub mb_stream {