diff --git a/ChangeLog b/ChangeLog index 470468ca5..482059eaf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2002-10-31 Pavel Roskin + * lib/mc.sh.in: Update to use the new -P option. + * configure.in: Displaying the install paths is too problematic to implement properly. Remove this code. diff --git a/lib/mc.sh.in b/lib/mc.sh.in index 064717ccf..a7058c820 100644 --- a/lib/mc.sh.in +++ b/lib/mc.sh.in @@ -1,12 +1,16 @@ mc () { - mkdir -p $HOME/.mc/tmp 2> /dev/null - chmod 700 $HOME/.mc/tmp - MC=$HOME/.mc/tmp/mc-$$ - @prefix@/bin/mc -P "$@" > "$MC" - cd "`cat $MC`" - rm -f "$MC" - unset MC; + MC_PWD_FILE="/tmp/mc-$USER/mc.pwd.$$" + @prefix@/bin/mc -P "$MC_PWD_FILE" "$@" + if test -r "$MC_PWD_FILE"; then + MC_PWD="`cat $MC_PWD_FILE`" + if test -n "$MC_PWD" && test -d "$MC_PWD"; then + cd "$MC_PWD" + fi + fi + rm -f "$MC_PWD_FILE" + unset MC_PWD + unset MC_PWD_FILE } if test -n "$BASH_VERSION"; then