summaryrefslogtreecommitdiffstats
path: root/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/parse.c b/parse.c
index 4e3f763..fadf0c5 100644
--- a/parse.c
+++ b/parse.c
@@ -3479,9 +3479,15 @@ struct bfs_ctx *bfs_parse_cmdline(int argc, char *argv[]) {
}
ctx->colors = parse_colors(getenv("LS_COLORS"));
+
ctx->cout = cfdup(stdout, use_color ? ctx->colors : NULL);
+ if (!ctx->cout) {
+ perror("cfdup()");
+ goto fail;
+ }
+
ctx->cerr = cfdup(stderr, use_color ? ctx->colors : NULL);
- if (!ctx->cout || !ctx->cerr) {
+ if (!ctx->cerr) {
perror("cfdup()");
goto fail;
}