2015-05-05 12:23:49 +02:00
|
|
|
---
|
2023-04-13 14:54:26 +02:00
|
|
|
tests/ls-F.at | 36 ++++++++++++++++++------------------
|
|
|
|
tw.color.c | 10 ++++------
|
|
|
|
2 files changed, 22 insertions(+), 24 deletions(-)
|
2015-05-05 12:23:49 +02:00
|
|
|
|
2023-04-13 14:54:26 +02:00
|
|
|
--- tests/ls-F.at
|
|
|
|
+++ tests/ls-F.at 2023-04-13 12:51:33.133052023 +0000
|
|
|
|
@@ -358,9 +358,9 @@ dnl
|
|
|
|
dnl Fail: environment LS_COLORS=YY:XX=0 exits with unknown 'XX'.
|
|
|
|
dnl (Unknown 'YY' is ignored.)
|
|
|
|
dnl
|
|
|
|
-AT_CHECK([LS_COLORS=YY:XX=0 tcsh -f -c 'set color;cd DIR && ls-F'], [1], [], [dnl
|
|
|
|
-Unknown LS_COLORS color variable 'XX'.
|
|
|
|
-])
|
|
|
|
+dnl AT_CHECK([LS_COLORS=YY:XX=0 tcsh -f -c 'set color;cd DIR && ls-F'], [1], [], [dnl
|
|
|
|
+dnl Unknown LS_COLORS color variable 'XX'.
|
|
|
|
+dnl ])
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl setenv LS_COLORS "YY:XX=0" warns for unknown 'XX='. (Unknown 'YY' is ignored').
|
|
|
|
@@ -368,11 +368,11 @@ dnl listflags=A, listlinks
|
|
|
|
dnl
|
|
|
|
dnl As per ls-F-color-default.out.
|
|
|
|
dnl
|
|
|
|
-TCSH_LS_F([${tests_dir}/ls-F-color-default.out],
|
|
|
|
- [],
|
|
|
|
- [setenv LS_COLORS "YY:XX=0"; set color listflags=A listlinks], [dnl
|
|
|
|
-Unknown LS_COLORS color variable 'XX'.
|
|
|
|
-])
|
|
|
|
+dnl TCSH_LS_F([${tests_dir}/ls-F-color-default.out],
|
|
|
|
+dnl [],
|
|
|
|
+dnl [setenv LS_COLORS "YY:XX=0"; set color listflags=A listlinks], [dnl
|
|
|
|
+dnl Unknown LS_COLORS color variable 'XX'.
|
|
|
|
+dnl ])
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl Check setenv LS_COLORS that all variables before an unknown variable are used.
|
|
|
|
@@ -383,11 +383,11 @@ dnl listflags=A, listlinks
|
|
|
|
dnl
|
|
|
|
dnl As per ls-F-LS_COLORS-all.out.
|
|
|
|
dnl
|
|
|
|
-TCSH_LS_F([${tests_dir}/ls-F-LS_COLORS-all.out],
|
|
|
|
- [],
|
|
|
|
- [setenv LS_COLORS "TCSH_TEXT_LS_COLORS:YY:XX=0"; set color listflags=A listlinks], [dnl
|
|
|
|
-Unknown LS_COLORS color variable 'XX'.
|
|
|
|
-])
|
|
|
|
+dnl TCSH_LS_F([${tests_dir}/ls-F-LS_COLORS-all.out],
|
|
|
|
+dnl [],
|
|
|
|
+dnl [setenv LS_COLORS "TCSH_TEXT_LS_COLORS:YY:XX=0"; set color listflags=A listlinks], [dnl
|
|
|
|
+dnl Unknown LS_COLORS color variable 'XX'.
|
|
|
|
+dnl ])
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl LS_COLORS as TCSH_TEXT_LS_COLORS, override with setenv LSCOLORS,
|
|
|
|
@@ -407,11 +407,11 @@ dnl override with LSCOLORS=Aa,
|
|
|
|
dnl then unsetenv LSCOLORS to reapply faulty LS_COLORS without warning.
|
|
|
|
dnl and results in default colors.
|
|
|
|
dnl
|
|
|
|
-TCSH_LS_F([${tests_dir}/ls-F-color-default.out],
|
|
|
|
- [],
|
|
|
|
- [setenv LS_COLORS XX=0; setenv LSCOLORS Aa; unsetenv LSCOLORS || echo FAIL; set color listflags=A listlinks], [dnl
|
|
|
|
-Unknown LS_COLORS color variable 'XX'.
|
|
|
|
-])
|
|
|
|
+dnl TCSH_LS_F([${tests_dir}/ls-F-color-default.out],
|
|
|
|
+dnl [],
|
|
|
|
+dnl [setenv LS_COLORS XX=0; setenv LSCOLORS Aa; unsetenv LSCOLORS || echo FAIL; set color listflags=A listlinks], [dnl
|
|
|
|
+dnl Unknown LS_COLORS color variable 'XX'.
|
|
|
|
+dnl ])
|
|
|
|
|
|
|
|
m4_popdef([TCSH_TEXT_LS_COLORS])
|
|
|
|
|
2011-11-17 11:34:10 +01:00
|
|
|
--- tw.color.c
|
2023-04-13 14:54:26 +02:00
|
|
|
+++ tw.color.c 2023-04-13 12:33:48.052952714 +0000
|
2023-04-11 12:49:58 +02:00
|
|
|
@@ -56,7 +56,7 @@ typedef struct {
|
|
|
|
typedef enum {
|
|
|
|
Vdi, Vln, Vor, Vpi, Vso, Vdo, Vbd, Vcd,
|
|
|
|
Vex, Vfi, Vno, Vmi, Vlc, Vrc, Vec, Vsu,
|
|
|
|
- Vsg, Vtw, Vow, Vst, Vrs, Vhl, Vmh, Vca,
|
|
|
|
+ Vsg, Vtw, Vow, Vst, Vrs, Vhl, Vmh, Vca, Vcl,
|
|
|
|
} VARINDEX;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
@@ -100,6 +100,7 @@ static Variable variables[] = {
|
|
|
|
VAR(Vhl, CV_NONE, "hl", ""), /* Obsolete, use mh */
|
|
|
|
VAR(Vmh, CV_HARD, "mh", ""), /* Regular file with multiple hard links */
|
|
|
|
VAR(Vca, CV_NONE, "ca", ""), /* File with capability. Not implemented. */
|
|
|
|
+ VAR(Vcl, CV_NONE, "cl", ""), /* CLRTOEOL */
|
2011-11-17 11:34:10 +01:00
|
|
|
};
|
|
|
|
|
2015-05-05 12:23:49 +02:00
|
|
|
#define nvariables (sizeof(variables)/sizeof(variables[0]))
|
2023-04-13 14:36:12 +02:00
|
|
|
@@ -369,7 +370,7 @@ parseLS_COLORS(const Char *value, int si
|
2011-11-17 11:34:10 +01:00
|
|
|
size_t i, len;
|
|
|
|
const Char *v; /* pointer in value */
|
|
|
|
char *c; /* pointer in colors */
|
|
|
|
- Extension *volatile e; /* pointer in extensions */
|
|
|
|
+ static Extension *volatile e; /* pointer in extensions */
|
|
|
|
jmp_buf_t osetexit;
|
|
|
|
size_t omark;
|
|
|
|
|
2023-04-13 14:36:12 +02:00
|
|
|
@@ -426,17 +427,14 @@ parseLS_COLORS(const Char *value, int si
|
2015-05-05 12:23:49 +02:00
|
|
|
if ((Char)variables[i].variable[0] == (v[0] & CHAR) &&
|
|
|
|
(Char)variables[i].variable[1] == (v[1] & CHAR))
|
|
|
|
break;
|
|
|
|
+ v += 3;
|
2021-11-11 14:26:29 +01:00
|
|
|
if (i < nvariables) {
|
|
|
|
- v += 3;
|
2015-05-05 12:23:49 +02:00
|
|
|
getstring(&c, &v, &variables[i].color, ':');
|
2023-04-11 12:49:58 +02:00
|
|
|
if (i == Vln)
|
|
|
|
color_as_referent = Str_equal_literal(
|
|
|
|
&variables[Vln].color, "target");
|
2021-11-11 14:26:29 +01:00
|
|
|
continue;
|
|
|
|
}
|
2015-05-05 12:23:49 +02:00
|
|
|
- else
|
2023-04-13 14:36:12 +02:00
|
|
|
- stderror(ERR_BADCOLORVAR | (silent ? ERR_SILENT : 0),
|
|
|
|
- "LS_COLORS", v[0], v[1]);
|
2015-05-05 12:23:49 +02:00
|
|
|
}
|
|
|
|
break;
|
2011-11-17 11:34:10 +01:00
|
|
|
}
|