mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
f57daa1678
This would make a subsequent "cd -" more convenient. If you don't alter the directory in mc, after exiting a "cd -" does nothing, whereas it could take you to the actual previous directory. Thanks Egmont Koblinger <egmont@gmail.com> for the initial patch. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
16 lines
334 B
Bash
16 lines
334 B
Bash
MC_USER=`whoami`
|
|
MC_PWD_FILE="${TMPDIR-/tmp}/mc-$MC_USER/mc.pwd.$$"
|
|
@bindir@/mc -P "$MC_PWD_FILE" "$@"
|
|
|
|
if test -r "$MC_PWD_FILE"; then
|
|
MC_PWD="`cat "$MC_PWD_FILE"`"
|
|
if test -n "$MC_PWD" && test "$MC_PWD" != "$PWD" && test -d "$MC_PWD"; then
|
|
cd "$MC_PWD"
|
|
fi
|
|
unset MC_PWD
|
|
fi
|
|
|
|
rm -f "$MC_PWD_FILE"
|
|
unset MC_PWD_FILE
|
|
unset MC_USER
|