Skip to content

Commit

Permalink
Do not attempt to print nothing
Browse files Browse the repository at this point in the history
This fixes a bug where an extra header line was printed when in --long --grid mode.
  • Loading branch information
ogham committed Sep 5, 2015
1 parent 6596735 commit 6cf9274
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,13 @@ impl Exa {
}
}

let any_files = files.is_empty();
self.print_files(None, files);
let no_files = files.is_empty();
if !no_files {
self.print_files(None, files);
}

let is_only_dir = dirs.len() == 1;
self.print_dirs(dirs, any_files, is_only_dir);
self.print_dirs(dirs, no_files, is_only_dir);
}

fn print_dirs(&self, dir_files: Vec<Dir>, mut first: bool, is_only_dir: bool) {
Expand Down

0 comments on commit 6cf9274

Please sign in to comment.