Fix a missing '/' in symlink targets

In cases where symlink targets were more than a single directory down,
exa did not print the '/' targets when separating directories, resulting
in the following output:

    symlink => dirAdirBdirC/file

Instead of

    symlink => dirA/dirB/dirC/file

By adding a '/' character after each component of the filename, this
error is fixed.
This commit is contained in:
Jonny Gilchrist 2015-02-24 03:28:34 +00:00
parent ea1b3caefa
commit 96cab9cd05

View File

@ -162,15 +162,10 @@ impl<'a> File<'a> {
for component in path_bytes.init().iter() {
let string = String::from_utf8_lossy(component).to_string();
path_prefix.push_str(&string);
path_prefix.push_str("/");
}
}
// Only add a slash when there's something in the path
// prefix so far.
if path_bytes.len() > 1 {
path_prefix.push_str("/");
}
format!("{} {} {}",
style.paint(name),
GREY.paint("=>"),