summaryrefslogtreecommitdiff
path: root/misc/colorls/files/patch-aa
diff options
context:
space:
mode:
authorChris Piazza <cpiazza@FreeBSD.org>1999-11-21 19:57:13 +0000
committerChris Piazza <cpiazza@FreeBSD.org>1999-11-21 19:57:13 +0000
commit427f82386174f193bd31ce5d088665b6816b59ea (patch)
tree5eaadc97d0bc12320a6440cc994828314f91f254 /misc/colorls/files/patch-aa
parentActivate xracer (diff)
Disable outputting colour codes if STDOUT isn't a tty.
PR: 8620 Submitted by: Martin Blapp <mb@imp.ch>
Notes
Notes: svn path=/head/; revision=23242
Diffstat (limited to '')
-rw-r--r--misc/colorls/files/patch-aa11
1 files changed, 6 insertions, 5 deletions
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;