Output a color indicator (which may contain nulls). */
| 5030 | |
| 5031 | /* Output a color indicator (which may contain nulls). */ |
| 5032 | static void |
| 5033 | put_indicator (const struct bin_str *ind) |
| 5034 | { |
| 5035 | if (! used_color) |
| 5036 | { |
| 5037 | used_color = true; |
| 5038 | |
| 5039 | /* If the standard output is a controlling terminal, watch out |
| 5040 | for signals, so that the colors can be restored to the |
| 5041 | default state if "ls" is suspended or interrupted. */ |
| 5042 | |
| 5043 | if (0 <= tcgetpgrp (STDOUT_FILENO)) |
| 5044 | signal_init (); |
| 5045 | |
| 5046 | prep_non_filename_text (); |
| 5047 | } |
| 5048 | |
| 5049 | fwrite (ind->string, ind->len, 1, stdout); |
| 5050 | } |
| 5051 | |
| 5052 | static size_t |
| 5053 | length_of_file_name_and_frills (const struct fileinfo *f) |
no test coverage detected