-- ps2eps/bin/ps2eps.fix_tmp 2007-06-02 18:14:46.000000000 +0200 +++ ps2eps/bin/ps2eps 2007-06-02 18:40:55.000000000 +0200 @@ -1,5 +1,4 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' # -*-perl-*- - if 0; +#! /usr/bin/perl # The expression in the previous line replaces the unix specific line # {#!/usr/bin/perl}. # ps2eps - convert PostScript to EPS (Encapsulated PostScript) files @@ -36,6 +35,7 @@ eval '(exit $?0)' && eval 'exec perl -S # for calculation of the actual BoundingBox) use POSIX; +use File::Temp qw/ tempfile /; #use warnings; @@ -105,29 +105,12 @@ $dummy=""; @ver= split(/ /,$version); # filename for temporary files -if ($^O =~ /MSWin32/i or $^O =~ /cygwin/i) +if ($^O =~ /MSWin32/i or $^O =~ /cygwin/i or defined($ENV{'TMP'})) { - # it is less trouble to use the current directory if working on - # cygwin and nevertheless using gswin32c. - $tmpfname= "$prgname.$$"; $win=1; } -elsif (defined($ENV{'TMP'})) -{ - $tmpdir= $ENV{'TMP'}; - $filesep= ($tmpdir =~ /^?\:\\/) ? '\\' : '/'; - if ($tmpdir =~ /$filesep$/) - { $tmpfname= $tmpdir . "$prgname.$$"; } - else - { $tmpfname= $tmpdir . "$filesep$prgname.$$"; } - $win=1; -} -else #assume we're on a UNIXBOX -{ - $tmpfname= "/tmp/" . "$prgname.$$"; - $win=0; -} +($fh, $tmpfname) = tempfile(UNLINK => 1); $licensetxt= "\ This program is free software; you can redistribute it and/or modify\