summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-06-29 13:53:48 -0400
committerTavian Barnes <tavianator@tavianator.com>2023-06-29 13:53:48 -0400
commit32cd0cbacfc6a4637915b40b7781976731599435 (patch)
tree36166fdd5db425d70f6e5f6134eaee835eb70b86
parent174a2027ff0db579e18d5efacb17c3addf6473f6 (diff)
downloadbfs-32cd0cbacfc6a4637915b40b7781976731599435.tar.xz
parse: Warn about errors parsing $LS_COLORS
-rw-r--r--src/parse.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/parse.c b/src/parse.c
index 1321270..623a528 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -1126,7 +1126,7 @@ static struct bfs_expr *parse_color(struct parser_state *state, int color, int a
if (color) {
if (!colors) {
- parse_expr_error(state, expr, "%s.\n", strerror(ctx->colors_error));
+ parse_expr_error(state, expr, "Error parsing $$LS_COLORS: %s.\n", strerror(ctx->colors_error));
bfs_expr_free(expr);
return NULL;
}
@@ -3725,6 +3725,10 @@ struct bfs_ctx *bfs_parse_cmdline(int argc, char *argv[]) {
}
}
+ if (state.use_color == COLOR_AUTO && !ctx->colors) {
+ bfs_warning(ctx, "Error parsing $$LS_COLORS: %s.\n\n", strerror(ctx->colors_error));
+ }
+
if (bfs_optimize(ctx) != 0) {
goto fail;
}