1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 20:17:45 +00:00

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

This commit is contained in:
Gerald E Butler 2017-11-13 21:34:40 -05:00
parent f2b952db54
commit 0268cf75cd

View file

@ -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;
}
}