--- a/hgeditor Thu May 27 22:50:23 2010 +0300
+++ b/hgeditor Wed May 19 18:06:35 2010 +0200
@@ -27,10 +27,10 @@
trap "cleanup_exit" 0 # normal exit
trap "exit 255" HUP INT QUIT ABRT TERM
-HGTMP="${TMPDIR-/tmp}/hgeditor.$RANDOM.$RANDOM.$RANDOM.$$"
-(umask 077 && mkdir "$HGTMP") || {
- echo "Could not create temporary directory! Exiting." 1>&2
- exit 1
+HGTMP=$(mktemp -d ${TMPDIR-/tmp}/hgeditor.XXXXXX)
+[ x$HGTMP != x -a -d $HGTMP ] || {
+ echo "Could not create temporary directory! Exiting." 1>&2
+ exit 1
}
(