about summary refs log tree commit homepage
path: root/script/public-inbox-edit
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-04-18 03:38:46 +0000
committerEric Wong <e@yhbt.net>2020-04-19 08:51:17 +0000
commit0f6b0cac5bf10d036a84dbab732e8991edf56c34 (patch)
tree043acb6313f02f5c3e934cdd48a7730c375defb7 /script/public-inbox-edit
parentd0147582e289fdd4cdd84e91d8b0f8ae9c230124 (diff)
downloadpublic-inbox-0f6b0cac5bf10d036a84dbab732e8991edf56c34.tar.gz
There's nothing Maildir-specific about the function, so
`maildir_path_load' was a bad name.  So give it a more
appropriate name and use it in our tests.

This save ourselves some code and inconsistency by reusing an
existing internal library routine in more places.  We can drop
the "From_" line in some of our (formerly) mbox sample files.
Diffstat (limited to 'script/public-inbox-edit')
-rwxr-xr-xscript/public-inbox-edit5
1 files changed, 2 insertions, 3 deletions
diff --git a/script/public-inbox-edit b/script/public-inbox-edit
index ae5d8289..28b1b5e8 100755
--- a/script/public-inbox-edit
+++ b/script/public-inbox-edit
@@ -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);