diff options
author | Eric Blake <ebb9@byu.net> | 2010-01-01 07:39:29 -0700 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2010-01-01 13:41:46 -0700 |
commit | b7f2b51c42edabd516c5ecc748a654da736c912c (patch) | |
tree | 75db10733b43f2bb3c46abc58b3384e77191f8af /src | |
parent | 84db964925680c912c601f616d4ab07f7bc19c3c (diff) | |
download | coreutils-b7f2b51c42edabd516c5ecc748a654da736c912c.tar.xz |
ls: fix color of broken symlinks colored as target
* src/ls.c (print_color_indicator): When using 'LINK target' in
dircolors, treat broken symlink as C_ORPHAN.
* tests/misc/ls-misc (sl-dangle2, sl-dangle3, sl-dangle4)
(sl-dangle5): Test for it, and add more coverage.
* NEWS: Document it.
* THANKS: Update.
Reported by Chris Jones.
Diffstat (limited to 'src')
-rw-r--r-- | src/ls.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -4164,7 +4164,9 @@ print_color_indicator (const struct fileinfo *f, bool symlink_target) type = C_STICKY; } else if (S_ISLNK (mode)) - type = ((!linkok && color_indicator[C_ORPHAN].string) + type = ((!linkok + && (!strncmp (color_indicator[C_LINK].string, "target", 6) + || color_indicator[C_ORPHAN].string)) ? C_ORPHAN : C_LINK); else if (S_ISFIFO (mode)) type = C_FIFO; |