]> Sergey Matveev's repositories - public-inbox.git/commitdiff
import: cat_blob drops leading 'From ' lines like Inbox
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Wed, 18 Apr 2018 09:13:12 +0000 (09:13 +0000)
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Wed, 18 Apr 2018 09:14:16 +0000 (09:14 +0000)
In case people were running old buggy versions from 2016...
(and -convert should probably clean those up, eventually)

lib/PublicInbox/Import.pm

index c7a96e1eabcc1214e6cdc61572ba6ed70db64750..b25427ee552628237bc094225f2daf24e98dcdac 100644 (file)
@@ -117,6 +117,9 @@ sub _cat_blob ($$$) {
        $n = read($r, my $lf, 1);
        defined($n) or die "read final byte of cat-blob failed: $!";
        die "bad read on final byte: <$lf>" if $lf ne "\n";
+
+       # fixup some bugginess in old versions:
+       $buf =~ s/\A[\r\n]*From [^\r\n]*\r?\n//s;
        \$buf;
 }