aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-05-28 21:43:44 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-05-28 21:43:44 +0200
commit421355dbd64ad33b815280a61b7f2e80bb2ec074 (patch)
tree2eb40bda8452fe3bb6b26c79cffbb80d6bd690a0
parent28f152d2b8ab699f8174d47d84660309c90e2527 (diff)
Check if stderr is a tty, not stdout
-rw-r--r--src/common/cerr.c2
1 files changed, 1 insertions, 1 deletions
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;
}