summaryrefslogtreecommitdiffstats
path: root/src/color.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/color.c')
-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;
}