diff options
| author | Jason King <jason@ansipunx.net> | 2009-09-04 13:09:17 -0700 |
|---|---|---|
| committer | Jason King <jason@ansipunx.net> | 2009-09-04 13:09:17 -0700 |
| commit | c7a7d03c9ffd42370747037f9120b7a975225e76 (patch) | |
| tree | 8cad401414743a1ef17d311830386ca072140b5b /usr/src/cmd/ls | |
| parent | 22fb2eeb50dd2ffd3aefea05536263203fae0600 (diff) | |
| download | illumos-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.c | 11 |
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; } |
