diff options
Diffstat (limited to 'ranger.py')
-rwxr-xr-x | ranger.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ranger.py b/ranger.py index 0991b451..1508b5de 100755 --- a/ranger.py +++ b/ranger.py @@ -23,7 +23,8 @@ if [ ! -z "$1" ]; then ranger="$1" shift "$ranger" --choosedir="$tempfile" "${@:-$(pwd)}" - if [ -f "$tempfile" -a "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then + test -f "$tempfile" && + if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then cd "$(cat "$tempfile")" rm -f -- "$tempfile" fi && return 0 |