]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
lei mail-diff: don't remove temporary subdirectory
authorEric Wong <e@80x24.org>
Sun, 1 Oct 2023 09:54:24 +0000 (09:54 +0000)
committerEric Wong <e@80x24.org>
Sun, 1 Oct 2023 22:41:46 +0000 (22:41 +0000)
->{curdir} is localized inside MailDiff->dump_eml anyways, so it
was attempting to remove `undef' :x.  Since most messages don't
have too many attachments, save some opcodes on our end and just
let File::Temp::Dir->DESTROY handle all the cleanup.

lib/PublicInbox/LeiMailDiff.pm

index 5e2e4b0b1468f0178600319cbecf8f0c60c6bee2..af6ecf828758dc010b5eb8dc259a9b5bb5cc80cd 100644 (file)
@@ -7,7 +7,6 @@ package PublicInbox::LeiMailDiff;
 use v5.12;
 use parent qw(PublicInbox::IPC PublicInbox::LeiInput PublicInbox::MailDiff);
 use PublicInbox::Spawn qw(run_wait);
-use File::Path ();
 require PublicInbox::LeiRediff;
 
 sub diff_a ($$) {
@@ -21,7 +20,6 @@ sub diff_a ($$) {
        my $rdr = { -C => "$self->{tmp}" };
        @$rdr{1, 2} = @$lei{1, 2};
        run_wait($cmd, $lei->{env}, $rdr) and $lei->child_error($?);
-       File::Path::remove_tree($self->{curdir});
 }
 
 sub input_eml_cb { # used by PublicInbox::LeiInput::input_fh