Magellan Linux

Contents of /trunk/coreutils/patches-5.3.0/coreutils-5.3.0-ls.c.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 44 - (show annotations) (download)
Thu Oct 13 21:17:16 2005 UTC (18 years, 7 months ago) by niro
File size: 2155 byte(s)
patch set for coretutils-5.3.0

1 --- fileutils-4.1/src/ls.c.orig Sun Apr 29 12:42:47 2001
2 +++ fileutils-4.1/src/ls.c Fri Jul 20 21:01:39 2001
3 @@ -510,13 +510,13 @@
4 enum indicator_no
5 {
6 C_LEFT, C_RIGHT, C_END, C_NORM, C_FILE, C_DIR, C_LINK, C_FIFO, C_SOCK,
7 - C_BLK, C_CHR, C_MISSING, C_ORPHAN, C_EXEC, C_DOOR
8 + C_BLK, C_CHR, C_MISSING, C_ORPHAN, C_EXEC, C_DOOR, C_UID, C_GID, C_WRO, C_WT
9 };
10
11 static const char *const indicator_name[]=
12 {
13 "lc", "rc", "ec", "no", "fi", "di", "ln", "pi", "so",
14 - "bd", "cd", "mi", "or", "ex", "do", NULL
15 + "bd", "cd", "mi", "or", "ex", "do", "su", "sg", "wo", "wt", NULL
16 };
17
18 struct color_ext_type
19 @@ -542,7 +542,11 @@
20 { 0, NULL }, /* mi: Missing file: undefined */
21 { 0, NULL }, /* or: Orphanned symlink: undefined */
22 { LEN_STR_PAIR ("01;32") }, /* ex: Executable: bright green */
23 - { LEN_STR_PAIR ("01;35") } /* do: Door: bright magenta */
24 + { LEN_STR_PAIR ("01;35") }, /* do: Door: bright magenta */
25 + { LEN_STR_PAIR ("37;41") }, /* su: setuid: white on red */
26 + { LEN_STR_PAIR ("30;43") }, /* sg: setgid: black on yellow */
27 + { LEN_STR_PAIR ("37;44") }, /* wo: writeable-other:white on blue */
28 + { LEN_STR_PAIR ("37;42") }, /* wt: wo w/ sticky: white on green */
29 };
30
31 /* FIXME: comment */
32 @@ -2883,7 +2887,14 @@
33 else
34 {
35 if (S_ISDIR (mode))
36 - type = C_DIR;
37 + {
38 + if ((mode && MODE_WT) == MODE_WT)
39 + type = C_WT;
40 + else if ((mode && MODE_WRO) == MODE_WRO)
41 + type = C_WRO;
42 + else
43 + type = C_DIR;
44 + }
45 else if (S_ISLNK (mode))
46 type = ((!linkok && color_indicator[C_ORPHAN].string)
47 ? C_ORPHAN : C_LINK);
48 @@ -2898,7 +2909,13 @@
49 else if (S_ISDOOR (mode))
50 type = C_DOOR;
51
52 - if (type == C_FILE && (mode & S_IXUGO) != 0)
53 + if ((type == C_FILE) && ((mode & S_ISUID) != 0))
54 + type = C_UID;
55 +
56 + else if ((type == C_FILE) && ((mode & S_ISGID) != 0))
57 + type = C_GID;
58 +
59 + else if (type == C_FILE && (mode & S_IXUGO) != 0)
60 type = C_EXEC;
61
62 /* Check the file's suffix only if still classified as C_FILE. */