GNU bug report logs -
#22067
[bug-diffutils] bug#20062: bug#20062: [PATCH] diff: add support for --color
Previous Next
Reported by: Gisle Vanem <gvanem <at> yahoo.no>
Date: Tue, 1 Dec 2015 09:58:02 UTC
Severity: normal
Tags: patch
Done: Jim Meyering <jim <at> meyering.net>
Bug is archived. No further changes may be made.
Full log
Message #38 received at 22067 <at> debbugs.gnu.org (full text, mbox):
Giuseppe Scrivano <gscrivano <at> gnu.org> writes:
> Jim Meyering <jim <at> meyering.net> 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 <gscrivano <at> gnu.org>
> 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
This bug report was last modified 9 years and 68 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.