]> Sergey Matveev's repositories - public-inbox.git/commitdiff
v2writable: DEBUG_DIFF respects $TMPDIR
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Thu, 22 Mar 2018 08:16:22 +0000 (08:16 +0000)
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Thu, 22 Mar 2018 08:16:22 +0000 (08:16 +0000)
The File::Temp API is a bit tricky and needs TMPDIR explicitly
enabled if a template is given.

lib/PublicInbox/V2Writable.pm

index 44b5528f5145bc3b751e604954de843280b3b23e..20c27363c3bb55290ef8a1b6c98144f0621e4f4d 100644 (file)
@@ -432,10 +432,10 @@ sub diff ($$$) {
        use File::Temp qw(tempfile);
        use PublicInbox::Spawn qw(spawn);
 
-       my ($ah, $an) = tempfile('email-cur-XXXXXXXX');
+       my ($ah, $an) = tempfile('email-cur-XXXXXXXX', TMPDIR => 1);
        print $ah $cur->as_string or die "print: $!";
        close $ah or die "close: $!";
-       my ($bh, $bn) = tempfile('email-new-XXXXXXXX');
+       my ($bh, $bn) = tempfile('email-new-XXXXXXXX', TMPDIR => 1);
        PublicInbox::Import::drop_unwanted_headers($new);
        print $bh $new->as_string or die "print: $!";
        close $bh or die "close: $!";