diff --git a/contrib/mc-wrapper.sh.in b/contrib/mc-wrapper.sh.in index 8badfb8..8da9412 100644 --- a/contrib/mc-wrapper.sh.in +++ b/contrib/mc-wrapper.sh.in @@ -1,6 +1,8 @@ MC_USER=`id | sed 's/[^(]*(//;s/).*//'` -MC_PWD_FILE="${TMPDIR-/tmp}/mc-$MC_USER/mc.pwd.$$" -@bindir@/mc -P "$MC_PWD_FILE" "$@" +[ ! -d ${TMPDIR-/tmp}/mc-$MC_USER ] && mkdir -p ${TMPDIR-/tmp}/mc-$MC_USER +if MC_PWD_FILE=`mktemp ${TMPDIR-/tmp}/mc-$MC_USER/mc.pwd.XXXXXXXXXX`; then +rm -f "$MC_PWD_FILE" +@bindir@/mc -r -P "$MC_PWD_FILE" "$@" if test -r "$MC_PWD_FILE"; then MC_PWD="`cat "$MC_PWD_FILE"`" @@ -12,3 +14,4 @@ fi rm -f "$MC_PWD_FILE" unset MC_PWD_FILE +fi