From 32cd0cbacfc6a4637915b40b7781976731599435 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 29 Jun 2023 13:53:48 -0400 Subject: parse: Warn about errors parsing $LS_COLORS --- src/parse.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/parse.c') 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; } -- cgit v1.2.3