summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/defaults/commands.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/ranger/defaults/commands.py b/ranger/defaults/commands.py
index 613d1bba..0b472378 100644
--- a/ranger/defaults/commands.py
+++ b/ranger/defaults/commands.py
@@ -106,6 +106,8 @@ class cd(Command):
 			import os.path
 			self.shift()
 			destination = os.path.realpath(self.rest(1))
+			if os.path.isfile(destination):
+				destination = os.path.dirname(destination)
 		else:
 			destination = self.rest(1)