summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKamil Dudka <kdudka@redhat.com>2009-06-10 19:44:43 +0200
committerJim Meyering <meyering@redhat.com>2009-06-11 09:53:50 +0200
commit0df338f6719ec2bcf1e1dea2d8b12dc66daf8a1e (patch)
tree4c77cf9c92a258da00f48e002142e9e4946d7bc1 /src
parent502be19e0fdb52dbc76fe95d5a4966ef0b06f3dc (diff)
downloadcoreutils-0df338f6719ec2bcf1e1dea2d8b12dc66daf8a1e.tar.xz
ls --color: do not colorize files with multiple hard links by default
* src/ls.c: Rename hl->mh, do not colorize files with multiple hard links by default. * src/dircolors.c: Rename HARDLINK -> MULTIHARDLINK, hl -> mh. * src/dircolors.hin: Do not colorize files with multiple hard links by default. * tests/Makefile.am: Rename the test case accordingly. * tests/ls/multihardlink: Additionally test ls' default behavior and factor out some duplication. * NEWS: Mention the change in behavior.
Diffstat (limited to 'src')
-rw-r--r--src/dircolors.c4
-rw-r--r--src/dircolors.hin2
-rw-r--r--src/ls.c10
3 files changed, 8 insertions, 8 deletions
diff --git a/src/dircolors.c b/src/dircolors.c
index f01d5575f..39c8e64b7 100644
--- a/src/dircolors.c
+++ b/src/dircolors.c
@@ -64,14 +64,14 @@ static const char *const slack_codes[] =
"CHR", "CHAR", "DOOR", "EXEC", "LEFT", "LEFTCODE", "RIGHT", "RIGHTCODE",
"END", "ENDCODE", "SUID", "SETUID", "SGID", "SETGID", "STICKY",
"OTHER_WRITABLE", "OWR", "STICKY_OTHER_WRITABLE", "OWT", "CAPABILITY",
- "HARDLINK", "CLRTOEOL", NULL
+ "MULTIHARDLINK", "CLRTOEOL", NULL
};
static const char *const ls_codes[] =
{
"no", "no", "fi", "rs", "di", "ln", "ln", "ln", "or", "mi", "pi", "pi",
"so", "bd", "bd", "cd", "cd", "do", "ex", "lc", "lc", "rc", "rc", "ec", "ec",
- "su", "su", "sg", "sg", "st", "ow", "ow", "tw", "tw", "ca", "hl", "cl", NULL
+ "su", "su", "sg", "sg", "st", "ow", "ow", "tw", "tw", "ca", "mh", "cl", NULL
};
verify (ARRAY_CARDINALITY (slack_codes) == ARRAY_CARDINALITY (ls_codes));
diff --git a/src/dircolors.hin b/src/dircolors.hin
index 5621259a2..30fd87856 100644
--- a/src/dircolors.hin
+++ b/src/dircolors.hin
@@ -70,7 +70,7 @@ RESET 0 # reset to "normal" color
DIR 01;34 # directory
LINK 01;36 # symbolic link. (If you set this to 'target' instead of a
# numerical value, the color is as for the file pointed to.)
-HARDLINK 44;37 # regular file with more than one link
+MULTIHARDLINK 00 # regular file with more than one link
FIFO 40;33 # pipe
SOCK 01;35 # socket
DOOR 01;35 # door
diff --git a/src/ls.c b/src/ls.c
index 838431c96..48bc47e90 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -529,7 +529,7 @@ enum indicator_no
C_LEFT, C_RIGHT, C_END, C_RESET, C_NORM, C_FILE, C_DIR, C_LINK,
C_FIFO, C_SOCK,
C_BLK, C_CHR, C_MISSING, C_ORPHAN, C_EXEC, C_DOOR, C_SETUID, C_SETGID,
- C_STICKY, C_OTHER_WRITABLE, C_STICKY_OTHER_WRITABLE, C_CAP, C_HARDLINK,
+ C_STICKY, C_OTHER_WRITABLE, C_STICKY_OTHER_WRITABLE, C_CAP, C_MULTIHARDLINK,
C_CLR_TO_EOL
};
@@ -537,7 +537,7 @@ static const char *const indicator_name[]=
{
"lc", "rc", "ec", "rs", "no", "fi", "di", "ln", "pi", "so",
"bd", "cd", "mi", "or", "ex", "do", "su", "sg", "st",
- "ow", "tw", "ca", "hl", "cl", NULL
+ "ow", "tw", "ca", "mh", "cl", NULL
};
struct color_ext_type
@@ -571,7 +571,7 @@ static struct bin_str color_indicator[] =
{ LEN_STR_PAIR ("34;42") }, /* ow: other-writable: blue on green */
{ LEN_STR_PAIR ("30;42") }, /* tw: ow w/ sticky: black on green */
{ LEN_STR_PAIR ("30;41") }, /* ca: black on red */
- { LEN_STR_PAIR ("44;37") }, /* hl: white on blue */
+ { 0, NULL }, /* mh: disabled by default */
{ LEN_STR_PAIR ("\033[K") }, /* cl: clear to end of line */
};
@@ -4106,8 +4106,8 @@ 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 (is_colored (C_HARDLINK) && (1 < nlink))
- type = C_HARDLINK;
+ else if (is_colored (C_MULTIHARDLINK) && (1 < nlink))
+ type = C_MULTIHARDLINK;
}
else if (S_ISDIR (mode))
{