Преглед изворни кода

Fix bug where the wrong level was used for . dir

Ben S пре 11 година
родитељ
комит
17657100b4
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      src/main.rs

+ 2 - 2
src/main.rs

@@ -18,7 +18,6 @@ extern crate git2;
 
 use std::env;
 use std::old_io::{fs, FileType};
-use std::path::Component::CurDir;
 
 use dir::Dir;
 use file::File;
@@ -114,7 +113,8 @@ impl<'a> Exa<'a> {
                     // time, so by inserting them backwards, they get displayed in
                     // the correct sort order.
                     if let Some(recurse_opts) = self.options.dir_action.recurse_options() {
-                        if !recurse_opts.tree && !recurse_opts.is_too_deep(dir_path.components().count() + 1) {
+                        let depth = dir_path.components().filter(|&c| c != b".").count() + 1;
+                        if !recurse_opts.tree && !recurse_opts.is_too_deep(depth) {
                             for dir in files.iter().filter(|f| f.stat.kind == FileType::Directory).rev() {
                                 self.dirs.push(dir.path.clone());
                             }