summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorBenjamin Sago <ogham@bsago.me>2015-09-05 17:40:02 +0100
committerBenjamin Sago <ogham@bsago.me>2015-09-05 17:40:02 +0100
commit6cf9274828bfecb21cc70c6ecdef52681542a746 (patch)
tree2d1fa0d5a09b7abe984882e141bdd4e136070bc9 /src/main.rs
parent65967355a88a4e6503e01e88100dedc3195109de (diff)
Do not attempt to print nothing
This fixes a bug where an extra header line was printed when in --long --grid mode.
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index 02f6ba9..e901a2d 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -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) {