From: Eric Wong Date: Sat, 25 Jan 2020 02:47:08 +0000 (+0000) Subject: mbox: handle empty subjects after dropping "Re:" prefix X-Git-Tag: v1.3.0~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0cf1c8b305e15d9ca9869c624a71c96b96a7a5cc;p=thirdparty%2Fpublic-inbox.git mbox: handle empty subjects after dropping "Re:" prefix We can't pass empty strings to `to_filename' without triggering warnings, and `to_filename' on an empty string makes no sense. --- diff --git a/lib/PublicInbox/Mbox.pm b/lib/PublicInbox/Mbox.pm index 1f9ac6ec8..cf93e7dbb 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 {