mirror of
https://github.com/Llewellynvdm/exa.git
synced 2025-02-02 10:38:24 +00:00
Merge pull request #171 from kballard/symlink_to_root
Handle linking to root directories better
This commit is contained in:
commit
c49820a935
@ -47,11 +47,7 @@ pub fn filename(file: &File, colours: &Colours, links: bool, classify: bool) ->
|
||||
bits.push(colours.punctuation.paint("->"));
|
||||
bits.push(Style::default().paint(" "));
|
||||
|
||||
if target.path.as_os_str() == "/" {
|
||||
// Do nothing when linking to the root directory.
|
||||
// The entirety of the path is the file name!
|
||||
}
|
||||
else if let Some(parent) = target.path.parent() {
|
||||
if let Some(parent) = target.path.parent() {
|
||||
let coconut = parent.components().count();
|
||||
|
||||
if coconut == 1 && parent.has_root() {
|
||||
@ -62,9 +58,6 @@ pub fn filename(file: &File, colours: &Colours, links: bool, classify: bool) ->
|
||||
bits.push(colours.symlink_path.paint("/"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
bits.push(colours.symlink_path.paint("/"));
|
||||
}
|
||||
|
||||
if !target.name.is_empty() {
|
||||
bits.push(file_colour(colours, &target).paint(target.name));
|
||||
|
Loading…
x
Reference in New Issue
Block a user