Skip to content

Commit 0edfb1a

Browse files
committed
Try to make temp file safer
1 parent 6f6938b commit 0edfb1a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

htmlify.p6

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,8 +712,10 @@ sub pygmentize-code-blocks {
712712
return default($node);
713713
}
714714
}
715-
my $tmp_fname = "$*TMPDIR/pod_to_pyg.pod";
715+
my $basename = join '-', %*ENV<USER> // 'u', (^100_000).pick, 'pod_to_pyg.pod';
716+
my $tmp_fname = "$*TMPDIR/$basename";
716717
spurt $tmp_fname, $node.contents.join;
718+
LEAVE try unlink $tmp_fname;
717719
my $command = "pygmentize -l perl6 -f html < $tmp_fname";
718720
return qqx{$command};
719721
}

0 commit comments

Comments
 (0)