diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2022-03-15 03:00:42 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2022-03-15 03:00:42 +0000 |
commit | a2c4034ff9d52ee2aff8d936ee9ceff01941ddd9 (patch) | |
tree | 5386f5ff929d517b5fee807a163c0bacf8b25f2b /editor | |
parent | 12fb730de9ce241bbb9f5accaf3ef7378d7f310d (diff) | |
download | netpbm-mirror-a2c4034ff9d52ee2aff8d936ee9ceff01941ddd9.tar.gz netpbm-mirror-a2c4034ff9d52ee2aff8d936ee9ceff01941ddd9.tar.xz netpbm-mirror-a2c4034ff9d52ee2aff8d936ee9ceff01941ddd9.zip |
Use better temp file name
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4306 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'editor')
-rwxr-xr-x | editor/pnmquant | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/editor/pnmquant b/editor/pnmquant index 0bebce69..4dd133f1 100755 --- a/editor/pnmquant +++ b/editor/pnmquant @@ -66,16 +66,17 @@ sub doVersionHack($) { sub tempFile($) { + my ($suffix) = @_; + # We trust Perl's File::Temp to do a better job of creating the temp # file, but it doesn't exist before Perl 5.6.1. if (eval { require File::Temp; 1 }) { return File::Temp::tempfile("pnmquant_XXXX", - SUFFIX=>".pnm", + SUFFIX=>$suffix, DIR=>File::Spec->tmpdir(), UNLINK=>$TRUE); } else { - my ($suffix) = @_; my $fileName; local *file; # For some inexplicable reason, must be local, not my my $i; |