Explorar o código

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.
Jonny Gilchrist %!s(int64=11) %!d(string=hai) anos
pai
achega
96cab9cd05
Modificáronse 1 ficheiros con 1 adicións e 6 borrados
  1. 1 6
      src/file.rs

+ 1 - 6
src/file.rs

@@ -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("=>"),