diff options
author | Eric Wong <e@yhbt.net> | 2020-04-18 03:38:46 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-04-19 08:51:17 +0000 |
commit | 0f6b0cac5bf10d036a84dbab732e8991edf56c34 (patch) | |
tree | 043acb6313f02f5c3e934cdd48a7730c375defb7 /lib/PublicInbox/InboxWritable.pm | |
parent | d0147582e289fdd4cdd84e91d8b0f8ae9c230124 (diff) | |
download | public-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 'lib/PublicInbox/InboxWritable.pm')
-rw-r--r-- | lib/PublicInbox/InboxWritable.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/InboxWritable.pm b/lib/PublicInbox/InboxWritable.pm index f2ba21fc..31aa76c6 100644 --- a/lib/PublicInbox/InboxWritable.pm +++ b/lib/PublicInbox/InboxWritable.pm @@ -111,7 +111,7 @@ sub is_maildir_path ($) { (is_maildir_basename($p[-1]) && -f $path) ? 1 : 0; } -sub maildir_path_load ($) { +sub mime_from_path ($) { my ($path) = @_; if (open my $fh, '<', $path) { local $/; @@ -138,7 +138,7 @@ sub import_maildir { opendir my $dh, "$dir/$sub" or die "opendir $dir/$sub: $!\n"; while (defined(my $fn = readdir($dh))) { next unless is_maildir_basename($fn); - my $mime = maildir_path_load("$dir/$fn") or next; + my $mime = mime_from_path("$dir/$fn") or next; if (my $filter = $self->filter($im)) { my $ret = $filter->scrub($mime) or return; |