From 0268cf75cd7eeb4566a0b346a5d56df60cdf5c35 Mon Sep 17 00:00:00 2001 From: Gerald E Butler Date: Mon, 13 Nov 2017 21:34:40 -0500 Subject: [PATCH] Added a check to see if the input file/path that ls is run on when using -l or other long options, that if the path part ends with '/' then it does not show it as a soft-link if it is a soft-link but, instead shows the directory contents of the directory the soft-link points to - see https://github.com/uutils/coreutils/issues/1093 --- src/ls/ls.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ls/ls.rs b/src/ls/ls.rs index 9ecdf0597..177ee42f8 100644 --- a/src/ls/ls.rs +++ b/src/ls/ls.rs @@ -160,7 +160,7 @@ fn list(options: getopts::Matches) { dir = true; if options.opt_present("l") && !(options.opt_present("L")) { if let Ok(md) = p.symlink_metadata() { - if md.file_type().is_symlink() { + if md.file_type().is_symlink() && !p.ends_with( "/" ) { dir = false; } }