From 427f82386174f193bd31ce5d088665b6816b59ea Mon Sep 17 00:00:00 2001 From: Chris Piazza Date: Sun, 21 Nov 1999 19:57:13 +0000 Subject: Disable outputting colour codes if STDOUT isn't a tty. PR: 8620 Submitted by: Martin Blapp --- misc/colorls/files/patch-aa | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'misc') diff --git a/misc/colorls/files/patch-aa b/misc/colorls/files/patch-aa index af47acfd3ff7..64f89c92561c 100644 --- a/misc/colorls/files/patch-aa +++ b/misc/colorls/files/patch-aa @@ -1,5 +1,5 @@ ---- ./ls.c.org Sun Jul 19 23:29:17 1998 -+++ ./ls.c Mon Aug 24 01:25:50 1998 +--- ls.c.orig Sun Jul 19 23:29:17 1998 ++++ ls.c Sun Nov 21 11:51:18 1999 @@ -94,6 +94,7 @@ int f_statustime; /* use time of last mode change */ int f_timesort; /* sort by time vice name */ @@ -17,17 +17,18 @@ switch (ch) { /* * The -1, -C and -l options all override each other so shell -@@ -169,6 +170,9 @@ +@@ -169,6 +170,10 @@ case 'H': fts_options |= FTS_COMFOLLOW; break; + case 'G': -+ f_color = 1; ++ if (isatty(STDOUT_FILENO)) ++ f_color = 1; + break; case 'L': fts_options &= ~FTS_PHYSICAL; fts_options |= FTS_LOGICAL; -@@ -236,18 +240,21 @@ +@@ -236,18 +241,21 @@ argc -= optind; argv += optind; -- cgit v1.2.3