about summary refs log tree commit diff
path: root/editor
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2022-03-15 03:01:41 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2022-03-15 03:01:41 +0000
commit03f1610a029f16fa7fc8bb6bc0c9070d66d59e74 (patch)
treeac07359e96ae4feb06c734488f7d7de3ddfcf291 /editor
parenta2c4034ff9d52ee2aff8d936ee9ceff01941ddd9 (diff)
downloadnetpbm-mirror-03f1610a029f16fa7fc8bb6bc0c9070d66d59e74.tar.gz
netpbm-mirror-03f1610a029f16fa7fc8bb6bc0c9070d66d59e74.tar.xz
netpbm-mirror-03f1610a029f16fa7fc8bb6bc0c9070d66d59e74.zip
Use better temp file name
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4307 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'editor')
-rwxr-xr-xeditor/pnmquantall5
1 files changed, 3 insertions, 2 deletions
diff --git a/editor/pnmquantall b/editor/pnmquantall
index 80d00fce..5f434fc2 100755
--- a/editor/pnmquantall
+++ b/editor/pnmquantall
@@ -117,16 +117,17 @@ sub parseArgs($$$$) {
 
 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;