bug-diffutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-diffutils] bug#22067: bug#22067: bug#22067: bug#20062: bug#20062: [


From: Giuseppe Scrivano
Subject: [bug-diffutils] bug#22067: bug#22067: bug#22067: bug#20062: bug#20062: [PATCH] diff: add support for --color
Date: Tue, 01 Mar 2016 09:25:01 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Giuseppe Scrivano <address@hidden> writes:

> Jim Meyering <address@hidden> writes:
>
>> Great! Thank you.
>>
>>> but it will need a change in the code as well, since
>>> the signals are installed only when outputting to a tty:
>> ...
>>> -  if (output_is_tty)
>>> +  if (output_is_tty || getenv ("DIFF_INSTALL_SIGNALS"))
>>>      install_signal_handlers ();
>>
>> However, we try very hard to avoid making tools depend on
>> environment variable settings more than they already do,
>> so how about a hidden, three-hyphen option, say,
>> ---presume-output-tty, analogous to rm's ---presume-input-tty?
>
> I have added a test that uses the new option ---presume-output-tty.
>
> From 4aea918d31454fdeaada5e2453bea3dfc2e25f8b Mon Sep 17 00:00:00 2001
> From: Giuseppe Scrivano <address@hidden>
> Date: Mon, 1 Feb 2016 09:58:52 +0100
> Subject: [PATCH] Fix an infinite recursion with --color
>
> * src/diff.h: New extern variable `presume_output_tty'.
> * src/diff.c: New enum PRESUME_OUTPUT_TTY_OPTION.
> (group_format_option): Add '-presume-output-tty'.
> (main): Handle PRESUME_OUTPUT_TTY_OPTION.
> * src/util.c: New variable `presume_output_tty'.
> (check_color_output): Handle presume_output_tty.
> (set_color_context): Call process_signals only when color_context is
> not RESET_CONTEXT.
> * tests/colors: Check that diff doesn't crash when interrupted
> in the middle of a color sequence.
>
> Reported by Gisle Vanem in http://debbugs.gnu.org/22067
> ---

ping.

Regards,
Giuseppe





reply via email to

[Prev in Thread] Current Thread [Next in Thread]