summaryrefslogtreecommitdiff
path: root/usr/src/cmd/ls
diff options
context:
space:
mode:
authorJason King <jason@ansipunx.net>2009-09-04 13:09:17 -0700
committerJason King <jason@ansipunx.net>2009-09-04 13:09:17 -0700
commitc7a7d03c9ffd42370747037f9120b7a975225e76 (patch)
tree8cad401414743a1ef17d311830386ca072140b5b /usr/src/cmd/ls
parent22fb2eeb50dd2ffd3aefea05536263203fae0600 (diff)
downloadillumos-joyent-c7a7d03c9ffd42370747037f9120b7a975225e76.tar.gz
6876792 ls --color=auto only likes ttys
Diffstat (limited to 'usr/src/cmd/ls')
-rw-r--r--usr/src/cmd/ls/ls.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr/src/cmd/ls/ls.c b/usr/src/cmd/ls/ls.c
index d2f4802085..5358e0e01d 100644
--- a/usr/src/cmd/ls/ls.c
+++ b/usr/src/cmd/ls/ls.c
@@ -453,12 +453,13 @@ main(int argc, char *argv[])
continue;
}
- if ((strcmp(optarg, "auto") == 0 ||
+ if (strcmp(optarg, "auto") == 0 ||
strcmp(optarg, "tty") == 0 ||
- strcmp(optarg, "if-tty") == 0) &&
- isatty(1) == 1) {
- colorflg++;
- statreq++;
+ strcmp(optarg, "if-tty") == 0) {
+ if (isatty(1) == 1) {
+ colorflg++;
+ statreq++;
+ }
continue;
}