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: Jim Meyering
Subject: [bug-diffutils] bug#22067: bug#22067: bug#22067: bug#20062: bug#20062: [PATCH] diff: add support for --color
Date: Mon, 7 Mar 2016 07:19:06 -0800

On Tue, Mar 1, 2016 at 12:25 AM, Giuseppe Scrivano <address@hidden> wrote:
> 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

Thank you, and sorry about the delay.
I noticed that on OS X, the new test passed even without
the fix, but didn't want to let that hold up the fix any longer.
I've adjusted the test slightly, to eliminate the tr pipes.
Will wait for your "ack", before pushing.

Attachment: 0001-diff-color-fix-an-infinite-recursion-bug.patch
Description: Text Data


reply via email to

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