summaryrefslogtreecommitdiff
path: root/src/ls.c
diff options
context:
space:
mode:
authorKamil Dudka <kdudka@redhat.com>2009-03-24 12:16:20 +0100
committerPádraig Brady <P@draigBrady.com>2009-03-24 16:11:00 +0000
commit2827bb5704a153a0b4ac9c4af8b83ed015012f68 (patch)
treee22a1019643c9de53f2e20af99edc07ee1d47ebb /src/ls.c
parentd1df6ef183a651c82b719c3eef6f81b899109a7e (diff)
downloadcoreutils-2827bb5704a153a0b4ac9c4af8b83ed015012f68.tar.xz
ls: make it possible to disable coloring of hard links
* src/ls.c (print_color_indicator): Don't color hard links if disabled (when there is an empty hl= in the LS_COLORS environment variable). * tests/ls/hardlink: Add test case for disabled hard link highlighting. * NEWS: Mention the change.
Diffstat (limited to 'src/ls.c')
-rw-r--r--src/ls.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ls.c b/src/ls.c
index fa6a59a9d..d30e5a087 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -4008,7 +4008,7 @@ print_color_indicator (const char *name, mode_t mode, int linkok,
type = C_CAP;
else if ((mode & S_IXUGO) != 0)
type = C_EXEC;
- else if (1 < nlink)
+ else if (is_colored (C_HARDLINK) && (1 < nlink))
type = C_HARDLINK;
}
else if (S_ISDIR (mode))