diff options
author | Eric Wong <e@yhbt.net> | 2020-01-25 02:47:08 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-01-25 09:00:39 +0000 |
commit | 0cf1c8b305e15d9ca9869c624a71c96b96a7a5cc (patch) | |
tree | 72a4e119bc31b1245ac7034a1825448cd78b7321 | |
parent | 2a56039ff6a6a8d0b04437b5463c172ecab002c5 (diff) | |
download | public-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.
-rw-r--r-- | lib/PublicInbox/Mbox.pm | 5 |
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 { |