--- ispell-3.2.06.epa7~/findaffix.X 2003-11-09 17:27:50 +0000 +++ ispell-3.2.06.epa7/findaffix.X 2004-07-02 21:09:11 +0000 @@ -131,8 +131,22 @@ # Get rid of all old RCS log lines in preparation for the 3.1 release. # # -TDIR=${TMPDIR-/tmp}/findaffix$$ -( umask 077 && mkdir ${TDIR} || ( echo "can't mkdir " ${TDIR} 1>&2 ; exit 1 ) ) + +PROG="${0##*/}" + +if ! TDIR="$(mktemp -d -t "$PROG.XXXXXXXXXX")"; then + echo "$PROG: mktemp failed" >&2 + exit 1 +fi +exit_handler() +{ + local rc=$? + trap - EXIT + rm -rf -- "$TDIR" + exit $rc +} +trap exit_handler SIGHUP SIGPIPE SIGINT SIGTERM EXIT + TMP=${TDIR}/faff$$ SORTTMP="-T ${TDIR}" # !!SORTTMP!! USAGE='Usage: findaffix [-p | -s] [-f] [-c] [-e elim] [-m min] [-M max] [-l low] [-t tabch] [files]' @@ -214,8 +228,7 @@ ;; esac done -trap "/bin/rm -rf ${TDIR}; exit 1" 1 2 15 -trap "/bin/rm -rf ${TDIR}; exit 0" 13 + # # We are ready to do the work. First, we collect all input, translate it # to lowercase, sort it (dropping duplications), and save it for later. --- ispell-3.2.06.epa7~/munchlist.X 2003-11-09 17:27:51 +0000 +++ ispell-3.2.06.epa7/munchlist.X 2004-07-02 20:59:37 +0000 @@ -154,8 +154,21 @@ # # -TDIR=${TMPDIR-/tmp}/munchlist$$ -( umask 077 && mkdir ${TDIR} || ( echo "can't mkdir " ${TDIR} 1>&2 ; exit 1 ) ) +PROG="${0##*/}" + +if ! TDIR="$(mktemp -d -t "PROG.XXXXXXXXXX")"; then + echo "$PROG: mktemp failed" >&2 + exit 1 +fi +exit_handler() +{ + local rc=$? + trap - EXIT + rm -rf -- "$TDIR" + exit $rc +} +trap exit_handler SIGHUP SIGPIPE SIGINT SIGTERM EXIT + TMP=${TDIR}/munch$$ if [ "X$MUNCHMAIL" != X ] @@ -321,7 +334,7 @@ verbose=true debug=yes fi -trap "/bin/rm -rf ${TDIR}; exit 1" 1 2 13 15 + # # Names of temporary files. This is just to make the code a little easier # to read.