]> git.ipfire.org Git - thirdparty/coreutils.git/commit
ls: with --group-directories-first, also group symlinked dirs
authorPádraig Brady <P@draigBrady.com>
Thu, 27 Dec 2018 14:12:05 +0000 (06:12 -0800)
committerPádraig Brady <P@draigBrady.com>
Sun, 13 Jan 2019 03:23:45 +0000 (19:23 -0800)
commit39ca7731e2879cf87a2199d18ed3a3731efb9172
treef7a0c8e342affd85c3a6c9166a264b612eacf24e
parentd5ab4cbe424e3e95140eec22ef828f50b2fb3067
ls: with --group-directories-first, also group symlinked dirs

* src/ls.c (is_linked_directory): A new function to
also consider symlinked directories.
(main): Rename check_symlink_color to check_symlink_mode,
and enable that with --group-directories-first.
(DIRFIRST_CHECK): Adjust to use is_linked_directory,
rather than just is_directory.
(gobble_file): Simplify to always update f->linkmode
if the stat() succeeds.
* tests/ls/group-dirs.sh: A new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the change in behavior.
Suggested by Amin Bandali in
https://lists.gnu.org/r/coreutils/2018-12/msg00017.html
NEWS
src/ls.c
tests/local.mk
tests/ls/group-dirs.sh [new file with mode: 0755]