summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2009-09-14 13:37:37 +0100
committerPádraig Brady <P@draigBrady.com>2009-09-21 13:16:44 +0100
commit3a169f4c5d9159283548178668d2fae6fced3030 (patch)
treef604d725323a55ca480e3eeb49421bc91048fe35 /tests
parent29ec834c3b076dbc1bd160ef780a58f5b086ce13 (diff)
downloadcoreutils-3a169f4c5d9159283548178668d2fae6fced3030.tar.xz
ls: handle disabling of colors consistently for all tile types
* src/ls.c (print_color_indicator): Use consistent syntax for all file and directory subtypes, and fall back to the color of the base type if there is no enabled color for the subtype. This allows turning off specific colors for o+w dirs for example. * tests/ls/color-dtype-dir: Add a case to test that turning off coloring for o+w directories, falls back to standard dir color. * NEWS: Mention the fix Introduced by commit ac467814, 2005-09-05, "Colorize set-user-ID ... files and sticky ... directories."
Diffstat (limited to 'tests')
-rwxr-xr-xtests/ls/color-dtype-dir20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ls/color-dtype-dir b/tests/ls/color-dtype-dir
index 5381a6684..3ccf10eb8 100755
--- a/tests/ls/color-dtype-dir
+++ b/tests/ls/color-dtype-dir
@@ -50,4 +50,24 @@ EOF
compare out exp || fail=1
+rm exp
+
+# Turn off colors for other-writable dirs and ensure
+# we fall back to the color for standard directories.
+
+LS_COLORS="ow=:" ls --color=always > out || fail=1
+cat -A out > o1 || fail=1
+echo >> o1 || fail=1
+mv o1 out || fail=1
+
+cat <<\EOF > exp || fail=1
+^[[0m^[[01;34md^[[0m$
+^[[01;34mother-writable^[[0m$
+out$
+^[[37;44msticky^[[0m$
+^[[m
+EOF
+
+compare out exp || fail=1
+
Exit $fail