]> Sergey Matveev's repositories - public-inbox.git/blobdiff - script/public-inbox-edit
inboxwritable: mime_from_path: reuse in more places
[public-inbox.git] / script / public-inbox-edit
index ae5d82893e281b5e2f79ef0d266a0221e0d29721..28b1b5e827a38abc9069a00e8df6db23651d6689 100755 (executable)
@@ -92,9 +92,8 @@ Multiple messages with different content found matching
                warn "Will edit all of them\n";
        }
 } else {
-       open my $fh, '<', $file or die "open($file) failed: $!";
-       my $orig = do { local $/; <$fh> };
-       my $mime = PublicInbox::MIME->new(\$orig);
+       my $mime = PublicInbox::InboxWritable::mime_from_path($file) or
+               die "open($file) failed: $!";
        my $mids = mids($mime->header_obj);
        find_mid($found, $_, \@ibxs) for (@$mids); # populates $found
        my $cid = content_id($mime);