Update the pcre2grep patch for colouring on Windows so that "auto" is the same
as "always".
This commit is contained in:
parent
e5f1ac32c0
commit
336da0bf5d
|
@ -3446,12 +3446,17 @@ if (locale != NULL)
|
|||
pcre2_set_character_tables(compile_context, character_tables);
|
||||
}
|
||||
|
||||
/* Sort out colouring */
|
||||
/* Sort out colouring. On non-Windows systems "auto" causes colouring only if
|
||||
the output is a terminal. On Windows systems "auto" is the same as "always". */
|
||||
|
||||
if (colour_option != NULL && strcmp(colour_option, "never") != 0)
|
||||
{
|
||||
if (strcmp(colour_option, "always") == 0) do_colour = TRUE;
|
||||
#if defined(_WIN32) || defined(WIN32)
|
||||
else if (strcmp(colour_option, "auto") == 0) do_colour = TRUE;
|
||||
#else
|
||||
else if (strcmp(colour_option, "auto") == 0) do_colour = is_stdout_tty();
|
||||
#endif
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "pcre2grep: Unknown colour setting \"%s\"\n",
|
||||
|
|
Loading…
Reference in New Issue