From f5bf601c7c2a94c73e1ac55e4e09fa2b7af7d81f Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Thu, 31 Oct 2002 05:26:54 +0000 Subject: [PATCH] * lib/mc.sh.in: Update to use the new -P option. --- ChangeLog | 2 ++ lib/mc.sh.in | 18 +++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) 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