Ticket #3355: mc-3355-wrapper-cd.patch

File mc-3355-wrapper-cd.patch, 455 bytes (added by egmont, 5 years ago)

Fix for sh (todo: csh needs to be fixed too)

  • contrib/mc-wrapper.sh.in

    diff --git a/contrib/mc-wrapper.sh.in b/contrib/mc-wrapper.sh.in
    index 8badfb8..dd5edd9 100644
    a b MC_PWD_FILE="${TMPDIR-/tmp}/mc-$MC_USER/mc.pwd.$$" 
    44 
    55if test -r "$MC_PWD_FILE"; then 
    66        MC_PWD="`cat "$MC_PWD_FILE"`" 
    7         if test -n "$MC_PWD" && test -d "$MC_PWD"; then 
     7        if test -n "$MC_PWD" && test "$MC_PWD" != "$PWD" && test -d "$MC_PWD"; then 
    88                cd "$MC_PWD" 
    99        fi 
    1010        unset MC_PWD