]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(decode_switches): Set print_with_color in one statement.
authorJim Meyering <jim@meyering.net>
Sat, 1 Jun 1996 23:08:35 +0000 (23:08 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 1 Jun 1996 23:08:35 +0000 (23:08 +0000)
src/ls.c

index 2d54c3fb0cbcc756461d1ccb2f4a4429acbc97f9..180ca8ba49961769529d3d47f69000a69c7e1c3b 100644 (file)
--- a/src/ls.c
+++ b/src/ls.c
@@ -1070,10 +1070,9 @@ decode_switches (int argc, char **argv)
              i = color_always;
            }
 
-         if (i == color_if_tty)
-           print_with_color = isatty (STDOUT_FILENO);
-         else
-           print_with_color = (i == color_always);
+         print_with_color = (i == color_always
+                             || (i == color_if_tty
+                                 && isatty (STDOUT_FILENO)));
 
          if (print_with_color)
            {