bug-diffutils
[Top][All Lists]
Advanced

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

[bug-diffutils] bug#20062: bug#20062: bug#20062: bug#20062: [PATCH] diff


From: Paul Eggert
Subject: [bug-diffutils] bug#20062: bug#20062: bug#20062: bug#20062: [PATCH] diff: add support for --color
Date: Fri, 11 Sep 2015 08:28:04 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0

Gisle Vanem wrote:
No. He added a 'reset_color_context (true);' inside
'signal_handler()'.

Ah, sorry, I was looking at the original edition of the patch.

I just now looked at <http://bugs.gnu.org/20062#101> and still see some problems. Mainly, it doesn't handle SIGTSTP properly. With SIGTSTP an application is supposed to reset the terminal and then resignal itself with SIGSTOP before really stopping. When restarting the application then needs to restore the terminal to the current state, if the current state is not the default. This is nearly impossible to do correctly with the proposed design. I suggest looking at how GNU ls does it: the signal handler merely sets a flag, and the application checks occasionally at safe places whether a signal has arrived.

A nit: when installing signals via 'signal', don't install a handler if 'signal' says the signal is being ignored.

Also, copyright papers need to be filed for diffutils before a nontrivial patch like this can be installed.





reply via email to

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