summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-06-08 13:19:57 -0400
committerTavian Barnes <tavianator@tavianator.com>2023-06-08 13:19:57 -0400
commit1d1443193878ae72e54560bb21de79668cd954b9 (patch)
treed3ceedfe927061594f3238bd7edf22d29e6c9d6d /src
parent4c2d7e8271a35409acaba228968ab7641397bbe6 (diff)
downloadbfs-1d1443193878ae72e54560bb21de79668cd954b9.tar.xz
color: `fi=0` should not fall back to `no`
Diffstat (limited to 'src')
-rw-r--r--src/color.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/color.c b/src/color.c
index a723084..87575c9 100644
--- a/src/color.c
+++ b/src/color.c
@@ -436,10 +436,11 @@ struct colors *parse_colors(void) {
ret |= init_color(colors, "err", "01;31", &colors->error);
// Defaults from man dir_colors
+ // "" means fall back to ->normal
ret |= init_color(colors, "no", NULL, &colors->normal);
- ret |= init_color(colors, "fi", NULL, &colors->file);
+ ret |= init_color(colors, "fi", "", &colors->file);
ret |= init_color(colors, "mh", NULL, &colors->multi_hard);
ret |= init_color(colors, "ex", "01;32", &colors->executable);
ret |= init_color(colors, "ca", NULL, &colors->capable);
@@ -472,8 +473,7 @@ struct colors *parse_colors(void) {
if (colors->link && strcmp(colors->link, "target") == 0) {
colors->link_as_target = true;
- dstrfree(colors->link);
- colors->link = NULL;
+ dstresize(&colors->link, 0);
}
return colors;
@@ -634,7 +634,7 @@ static const char *file_color(const struct colors *colors, const char *filename,
break;
}
- if (!color) {
+ if (color && !color[0]) {
color = colors->normal;
}