From 2827bb5704a153a0b4ac9c4af8b83ed015012f68 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Tue, 24 Mar 2009 12:16:20 +0100 Subject: 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. --- src/ls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ls.c') 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)) -- cgit v1.2.3-54-g00ecf