mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
Ticket #3355: mc-wrapper: don't cd to the same directory.
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>
This commit is contained in:
parent
f25135b74b
commit
f57daa1678
@ -10,7 +10,7 @@ endif
|
||||
|
||||
if (-r "$MC_PWD_FILE") then
|
||||
setenv MC_PWD "`cat '$MC_PWD_FILE'`"
|
||||
if ( -d "$MC_PWD" ) then
|
||||
if ("$MC_PWD" != "$cwd" && -d "$MC_PWD") then
|
||||
cd "$MC_PWD"
|
||||
endif
|
||||
unsetenv MC_PWD
|
||||
|
@ -4,7 +4,7 @@ MC_PWD_FILE="${TMPDIR-/tmp}/mc-$MC_USER/mc.pwd.$$"
|
||||
|
||||
if test -r "$MC_PWD_FILE"; then
|
||||
MC_PWD="`cat "$MC_PWD_FILE"`"
|
||||
if test -n "$MC_PWD" && test -d "$MC_PWD"; then
|
||||
if test -n "$MC_PWD" && test "$MC_PWD" != "$PWD" && test -d "$MC_PWD"; then
|
||||
cd "$MC_PWD"
|
||||
fi
|
||||
unset MC_PWD
|
||||
|
Loading…
Reference in New Issue
Block a user