From ffa0d9869fe04de4649c4101f2117473ad91fcdf Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sun, 24 Apr 2016 22:54:44 +0000 Subject: Add -version, change temporary file handling git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2717 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- editor/pnmmargin | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'editor/pnmmargin') diff --git a/editor/pnmmargin b/editor/pnmmargin index 0f57d1d4..9dbe24b7 100755 --- a/editor/pnmmargin +++ b/editor/pnmmargin @@ -11,9 +11,8 @@ # documentation. This software is provided "as is" without express or # implied warranty. -tempdir="${TMPDIR-/tmp}/pnmmargin.$$" -mkdir -m 0700 $tempdir || \ - { echo "Could not create temporary file. Exiting." 1>&2; 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 tmp1=$tempdir/pnmm1 @@ -27,6 +26,9 @@ plainopt="" # Parse args. while true ; do case "$1" in + -version|--version ) + pnmpad --version; exit $?; + ;; -p|-pl|-pla|-plai|-plain ) plainopt="-plain" shift -- cgit 1.4.1