diff options
Diffstat (limited to 'editor/pamstretch-gen')
-rwxr-xr-x | editor/pamstretch-gen | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/editor/pamstretch-gen b/editor/pamstretch-gen index ba0e8188..dac3da7f 100755 --- a/editor/pamstretch-gen +++ b/editor/pamstretch-gen @@ -25,15 +25,17 @@ # Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # +if [ "$1" = "--version" -o "$1" = "-version" ]; then + pamstretch --version; exit $?; +fi if [ "$1" = "" ]; then echo 'usage: pamstretch-gen N [pnmfile]' exit 1 fi -tempdir="${TMPDIR-/tmp}/pamstretch-gen.$$" -mkdir -m 0700 $tempdir || \ - { echo "Could not create temporary file. Exiting."; exit 1;} +tempdir=$(mktemp -d "${TMPDIR:-/tmp}/netpbm.XXXXXXXX") || + ( echo "Could not create temporary file. Exiting." 1>&2; exit 1; ) trap 'rm -rf $tempdir' 0 1 3 15 tempfile=$tempdir/pnmig |