diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2023-06-29 13:53:48 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2023-06-29 13:53:48 -0400 |
commit | 32cd0cbacfc6a4637915b40b7781976731599435 (patch) | |
tree | 36166fdd5db425d70f6e5f6134eaee835eb70b86 /src/parse.c | |
parent | 174a2027ff0db579e18d5efacb17c3addf6473f6 (diff) | |
download | bfs-32cd0cbacfc6a4637915b40b7781976731599435.tar.xz |
parse: Warn about errors parsing $LS_COLORS
Diffstat (limited to 'src/parse.c')
-rw-r--r-- | src/parse.c | 6 |
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; } |