MCPcopy Create free account
hub / github.com/coreutils/coreutils / put_indicator

Function put_indicator

src/ls.c:5032–5050  ·  view source on GitHub ↗

Output a color indicator (which may contain nulls). */

Source from the content-addressed store, hash-verified

5030
5031/* Output a color indicator (which may contain nulls). */
5032static void
5033put_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
5052static size_t
5053length_of_file_name_and_frills (const struct fileinfo *f)

Callers 5

restore_default_colorFunction · 0.85
set_normal_colorFunction · 0.85
print_name_with_quotingFunction · 0.85
prep_non_filename_textFunction · 0.85
print_color_indicatorFunction · 0.85

Calls 2

signal_initFunction · 0.85
prep_non_filename_textFunction · 0.85

Tested by

no test coverage detected