summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorMilan Svoboda <msvoboda@ra.rockwell.com>2014-11-22 09:14:03 +0100
committerMilan Svoboda <msvoboda@ra.rockwell.com>2014-11-22 09:14:03 +0100
commit9f7001379a88666ad07c7d04a5164ef802499481 (patch)
tree7f639405d336e885dd35d4e784679529cb6c0abc /ranger
parent518cda572449aa16f2cfdbc7690a5ad030f145b5 (diff)
downloadranger-9f7001379a88666ad07c7d04a5164ef802499481.tar.gz
follow symlinks to directories if flat is not -1
Diffstat (limited to 'ranger')
-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: