summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/container/directory.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/ranger/container/directory.py b/ranger/container/directory.py
index 506d1052..f0cb4067 100644
--- a/ranger/container/directory.py
+++ b/ranger/container/directory.py
@@ -47,9 +47,10 @@ def accept_file(fname, directory, hidden_filter, name_filter):
 
 def walklevel(some_dir, level):
     some_dir = some_dir.rstrip(os.path.sep)
+    followlinks = True if level > 0 else False
     assert os.path.isdir(some_dir)
     num_sep = some_dir.count(os.path.sep)
-    for root, dirs, files in os.walk(some_dir):
+    for root, dirs, files in os.walk(some_dir, followlinks=followlinks):
         yield root, dirs, files
         num_sep_this = root.count(os.path.sep)
         if level != -1 and num_sep + level <= num_sep_this: