GNU bug report logs - #20062
[PATCH] diff: add support for --color

Previous Next

Package: diffutils;

Reported by: Giuseppe Scrivano <gscrivan <at> redhat.com>

Date: Sun, 8 Mar 2015 21:57:02 UTC

Severity: normal

Tags: patch

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Giuseppe Scrivano <gscrivan <at> redhat.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Eric Blake <eblake <at> redhat.com>, 20062 <at> debbugs.gnu.org
Subject: bug#20062: [bug-diffutils] bug#20062: bug#20062: [PATCH] diff: add support for --color
Date: Wed, 11 Mar 2015 00:43:57 +0100
Paul Eggert <eggert <at> cs.ucla.edu> writes:

> Giuseppe Scrivano wrote:
>
>> +  sigemptyset (&set);
>> +  for (j = 0; j < (sizeof (sig) / sizeof (*sig)); j++)
>> +    sigaddset (&set, sig[j]);
>
> Shouldn't the above part be done just once?  Also, it has redundant parentheses.
>
>> +      sigprocmask (SIG_BLOCK, &set, &old_sigproc_set);
>
> The sigprocmask module needs to be added to bootstrap.conf.
>
> Can the proposed implementation block signals for an unbounded amount
> of time? That would be bad.  ls.c attempts to avoid this problem, and
> 'diff' should too.

The change of color context is done per line (except in normal.c where
at the moment it is per hunk but I will change it to be per line) so the
most it can hang is the time needed to print a single line.


> Also, 'diff --color' needn't mess with signal handling unless isatty
> (fileno (outfile)).

Should this also be done if --color=always is used?

Thanks,
Giuseppe




This bug report was last modified 8 years and 78 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.