aboutsummaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorcpiazza <cpiazza@FreeBSD.org>1999-11-22 03:57:13 +0800
committercpiazza <cpiazza@FreeBSD.org>1999-11-22 03:57:13 +0800
commite418691a784e06e6ca40965e7f4cb87c9afb29cc (patch)
tree35665a09d13c65a195173b0664d30dc597fe67a7 /misc
parent8e26267e2d5f4cbbc5b77429bfe82321a87e4c2d (diff)
downloadfreebsd-ports-gnome-e418691a784e06e6ca40965e7f4cb87c9afb29cc.tar.gz
freebsd-ports-gnome-e418691a784e06e6ca40965e7f4cb87c9afb29cc.tar.zst
freebsd-ports-gnome-e418691a784e06e6ca40965e7f4cb87c9afb29cc.zip
Disable outputting colour codes if STDOUT isn't a tty.
PR: 8620 Submitted by: Martin Blapp <mb@imp.ch>
Diffstat (limited to 'misc')
-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;