about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/core/actions.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 8424b51d..ea4b54eb 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -451,16 +451,12 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
     def enter_dir(self, path, remember=False, history=True):
         """Enter the directory at the given path"""
         cwd = self.thisdir
-        # bash and ksh syntax
-        cdpath = os.environ.get('CDPATH', None)
-        if cdpath == "":
-            # zsh and csh syntax
-            os.environ.get('cdpath', None)
-        paths = cdpath.split(':')
+        # csh variable is lowercase
+        cdpath = os.environ.get('CDPATH', None) or os.environ.get('cdpath', None)
         result = self.thistab.enter_dir(path, history=history)
-        if result == 0:
-            for p in paths:
-                curpath = p + '/' + path
+        if result == 0 and cdpath:
+            for p in cdpath.split(':'):
+                curpath = os.path.join(p, path)
                 if os.path.isdir(curpath):
                     result = self.thistab.enter_dir(curpath, history=history)
                     break