mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 10:04:32 +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
|
if (-r "$MC_PWD_FILE") then
|
||||||
setenv MC_PWD "`cat '$MC_PWD_FILE'`"
|
setenv MC_PWD "`cat '$MC_PWD_FILE'`"
|
||||||
if ( -d "$MC_PWD" ) then
|
if ("$MC_PWD" != "$cwd" && -d "$MC_PWD") then
|
||||||
cd "$MC_PWD"
|
cd "$MC_PWD"
|
||||||
endif
|
endif
|
||||||
unsetenv MC_PWD
|
unsetenv MC_PWD
|
||||||
|
@ -4,7 +4,7 @@ MC_PWD_FILE="${TMPDIR-/tmp}/mc-$MC_USER/mc.pwd.$$"
|
|||||||
|
|
||||||
if test -r "$MC_PWD_FILE"; then
|
if test -r "$MC_PWD_FILE"; then
|
||||||
MC_PWD="`cat "$MC_PWD_FILE"`"
|
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"
|
cd "$MC_PWD"
|
||||||
fi
|
fi
|
||||||
unset MC_PWD
|
unset MC_PWD
|
||||||
|
Loading…
Reference in New Issue
Block a user