| 213 | } |
| 214 | |
| 215 | int finalize_colopts(unsigned int *colopts, int stdout_is_tty) |
| 216 | { |
| 217 | if ((*colopts & COL_ENABLE_MASK) == COL_AUTO) { |
| 218 | if (stdout_is_tty < 0) |
| 219 | stdout_is_tty = isatty(1); |
| 220 | *colopts &= ~COL_ENABLE_MASK; |
| 221 | if (stdout_is_tty || pager_in_use()) |
| 222 | *colopts |= COL_ENABLED; |
| 223 | } |
| 224 | return 0; |
| 225 | } |
| 226 | |
| 227 | struct colopt { |
| 228 | const char *name; |
no test coverage detected