about summary refs log tree commit diff
path: root/editor
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2016-04-30 18:48:31 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2016-04-30 18:48:31 +0000
commit896d19f9904c7e84c115b68c7ed0c9da43c604a0 (patch)
treeca6a44ff09ceeb37fe844728bf2fcb5a64bd4df9 /editor
parent584f4cba5bd8abdd755f8bfa10bd75a2de65264b (diff)
downloadnetpbm-mirror-896d19f9904c7e84c115b68c7ed0c9da43c604a0.tar.gz
netpbm-mirror-896d19f9904c7e84c115b68c7ed0c9da43c604a0.tar.xz
netpbm-mirror-896d19f9904c7e84c115b68c7ed0c9da43c604a0.zip
Add -version
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2726 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'editor')
-rwxr-xr-xeditor/pamstretch-gen8
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