diff options
author | Eric Wong <e@80x24.org> | 2021-02-12 00:05:52 -0700 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-02-12 22:58:31 -0400 |
commit | 376778b910cdf787d6e08cfd11acab26118899f4 (patch) | |
tree | fac5cc3de7cefa9629510917ca98bc4d9ac40758 /lib/PublicInbox | |
parent | 1138a7a940ec40ad4394aa55413456a6f6fd341e (diff) | |
download | public-inbox-376778b910cdf787d6e08cfd11acab26118899f4.tar.gz |
It's conceivable some cases won't generate an empty line before an mboxrd or mboxo From_ line. Ensure we can handle that case and don't leave the Eml->{bdy} without a trailing LF character. And drop an unnecessary alarm import while we're in the area.
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r-- | lib/PublicInbox/MboxReader.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/MboxReader.pm b/lib/PublicInbox/MboxReader.pm index 59ce4fb6..df7c78fa 100644 --- a/lib/PublicInbox/MboxReader.pm +++ b/lib/PublicInbox/MboxReader.pm @@ -26,7 +26,7 @@ sub _mbox_from { } @raw = grep /[^ \t\r\n]/s, @raw; # skip empty messages while (defined(my $raw = shift @raw)) { - $raw =~ s/\r?\n\z//s; + $raw =~ s/^\r?\n\z//ms; $raw =~ s/$from_re/$1/gms; my $eml = PublicInbox::Eml->new(\$raw); $eml_cb->($eml, @arg); |