2015-05-05 12:23:49 +02:00
|
|
|
---
|
2021-11-11 14:26:29 +01:00
|
|
|
tw.color.c | 20 ++++++++++----------
|
|
|
|
1 file changed, 10 insertions(+), 10 deletions(-)
|
2015-05-05 12:23:49 +02:00
|
|
|
|
2011-11-17 11:34:10 +01:00
|
|
|
--- tw.color.c
|
2021-11-11 14:26:29 +01:00
|
|
|
+++ tw.color.c 2021-11-11 11:00:40.989284076 +0000
|
2019-05-09 10:55:54 +02:00
|
|
|
@@ -85,6 +85,7 @@ static Variable variables[] = {
|
2011-11-17 11:34:10 +01:00
|
|
|
VAR(NOS, "hl", "44;37"), /* Reg file extra hard links, obsolete? */
|
|
|
|
VAR(NOS, "mh", "44;37"), /* Reg file extra hard links */
|
|
|
|
VAR(NOS, "ca", "30;41"), /* File with capability */
|
2015-05-05 12:23:49 +02:00
|
|
|
+ VAR(NOS, "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]))
|
2021-11-11 14:26:29 +01:00
|
|
|
@@ -324,7 +325,7 @@ parseLS_COLORS(const Char *value)
|
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;
|
|
|
|
|
2021-11-11 14:26:29 +01:00
|
|
|
@@ -381,16 +382,14 @@ parseLS_COLORS(const Char *value)
|
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, ':');
|
2021-11-11 14:26:29 +01:00
|
|
|
if (i == VSym)
|
|
|
|
color_as_referent = strcasecmp(
|
|
|
|
variables[VSym].color.s, "target") == 0;
|
|
|
|
continue;
|
|
|
|
}
|
2015-05-05 12:23:49 +02:00
|
|
|
- else
|
|
|
|
- stderror(ERR_BADCOLORVAR, v[0], v[1]);
|
|
|
|
}
|
|
|
|
break;
|
2011-11-17 11:34:10 +01:00
|
|
|
}
|
2021-11-11 14:26:29 +01:00
|
|
|
@@ -449,12 +448,13 @@ print_color(const Char *fname, size_t le
|
2011-11-17 11:34:10 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (i == nvariables) {
|
|
|
|
- for (i = 0; i < nextensions; i++)
|
|
|
|
- if (len >= extensions[i].extension.len
|
|
|
|
- && strncmp(last - extensions[i].extension.len,
|
|
|
|
- extensions[i].extension.s,
|
|
|
|
- extensions[i].extension.len) == 0) {
|
2015-05-05 12:23:49 +02:00
|
|
|
- colorp = &extensions[i].color;
|
2011-11-17 11:34:10 +01:00
|
|
|
+ int j;
|
|
|
|
+ for (j = 0; j < nextensions; j++)
|
|
|
|
+ if (len >= extensions[j].extension.len
|
|
|
|
+ && strncmp(last - extensions[j].extension.len,
|
|
|
|
+ extensions[j].extension.s,
|
|
|
|
+ extensions[j].extension.len) == 0) {
|
2015-05-05 12:23:49 +02:00
|
|
|
+ colorp = &extensions[j].color;
|
2011-11-17 11:34:10 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|