bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch 3/4] remove hardcoded colors


From: Jan Engelhardt
Subject: [patch 3/4] remove hardcoded colors
Date: Sat, 21 Jun 2008 12:49:16 +0200 (CEST)
User-agent: Alpine 1.10 (LNX 962 2008-03-14)

I think ls should not hardcode _any_ colors.

---
 src/ls.c                 |   18 +++++++++---------
 tests/ls/color-dtype-dir |    6 +++---
 2 files changed, 12 insertions(+), 12 deletions(-)

Index: coreutils-6.11/src/ls.c
===================================================================
--- coreutils-6.11.orig/src/ls.c
+++ coreutils-6.11/src/ls.c
@@ -537,19 +537,19 @@ static struct bin_str color_indicator[] 
     { LEN_STR_PAIR ("\033[") },                /* lc: Left of color sequence */
     { LEN_STR_PAIR ("m") },            /* rc: Right of color sequence */
     { 0, NULL },                       /* ec: End color (replaces lc+no+rc) */
-    { LEN_STR_PAIR ("0") },            /* rs: Reset to ordinary colors */
+    { 0, NULL },                       /* rs: Reset to ordinary colors */
     { 0, NULL },                       /* no: Normal */
     { 0, NULL },                       /* fi: File: default */
-    { LEN_STR_PAIR ("01;34") },                /* di: Directory: bright blue */
-    { LEN_STR_PAIR ("01;36") },                /* ln: Symlink: bright cyan */
-    { LEN_STR_PAIR ("33") },           /* pi: Pipe: yellow/brown */
-    { LEN_STR_PAIR ("01;35") },                /* so: Socket: bright magenta */
-    { LEN_STR_PAIR ("01;33") },                /* bd: Block device: bright 
yellow */
-    { LEN_STR_PAIR ("01;33") },                /* cd: Char device: bright 
yellow */
+    { 0, NULL },                       /* di: Directory: bright blue */
+    { 0, NULL },                       /* ln: Symlink: bright cyan */
+    { 0, NULL },                       /* pi: Pipe: yellow/brown */
+    { 0, NULL },                       /* so: Socket: bright magenta */
+    { 0, NULL },                       /* bd: Block device: bright yellow */
+    { 0, NULL },                       /* cd: Char device: bright yellow */
     { 0, NULL },                       /* mi: Missing file: undefined */
     { 0, NULL },                       /* or: Orphaned symlink: undefined */
-    { LEN_STR_PAIR ("01;32") },                /* ex: Executable: bright green 
*/
-    { LEN_STR_PAIR ("01;35") },                /* do: Door: bright magenta */
+    { 0, NULL },                       /* ex: Executable: bright green */
+    { 0, NULL },                       /* do: Door: bright magenta */
     { 0, NULL },                       /* su: setuid: white on red */
     { 0, NULL },                       /* sg: setgid: black on yellow */
     { 0, NULL },                       /* st: sticky: black on blue */
Index: coreutils-6.11/tests/ls/color-dtype-dir
===================================================================
--- coreutils-6.11.orig/tests/ls/color-dtype-dir
+++ coreutils-6.11/tests/ls/color-dtype-dir
@@ -41,10 +41,10 @@ echo >> o1 || fail=1
 mv o1 out || fail=1
 
 cat <<\EOF > exp || fail=1
-^[[0m^[[01;34md^[[0m$
-^[[34;42mother-writable^[[0m$
+^[[m^[[md^[[m$
+^[[mother-writable^[[m$
 out$
-^[[37;44msticky^[[0m$
+^[[msticky^[[m$
 ^[[m
 EOF
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]