From 421355dbd64ad33b815280a61b7f2e80bb2ec074 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 28 May 2024 21:43:44 +0200 Subject: Check if stderr is a tty, not stdout --- src/common/cerr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/common') diff --git a/src/common/cerr.c b/src/common/cerr.c index 98bca0f..a9df061 100644 --- a/src/common/cerr.c +++ b/src/common/cerr.c @@ -34,7 +34,7 @@ cerrinit(const char *s) const char *p = strrchr(s, '/'); progname = p ? p + 1 : s; - if (isatty(STDOUT_FILENO)) { + if (isatty(STDERR_FILENO)) { const char *ev = getenv("NO_COLOR"); color = !ev || !*ev; } -- cgit v1.2.3