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

Previous Next

Package: diffutils;

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


View this message in rfc822 format

From: Giuseppe Scrivano <gscrivano <at> gnu.org>
To: Gisle Vanem <gvanem <at> yahoo.no>
Cc: Jim Meyering <jim <at> meyering.net>, 22067 <at> debbugs.gnu.org
Subject: bug#22067: [bug-diffutils] bug#22067: bug#20062: bug#20062: [PATCH] diff: add support for --color
Date: Mon, 01 Feb 2016 10:10:05 +0100
[Message part 1 (text/plain, inline)]
Giuseppe Scrivano <gscrivano <at> gnu.org> writes:

> Bug 3 is a bug on all platforms, set_color_context should call
> process_signals only when color_context != RESET_CONTEXT.  I'll send a
> patch for that.

I've attached a patch for this bug.

Regards,
Giuseppe

[0001-Fix-an-infinite-recursion-with-color.patch (text/x-patch, inline)]
From c9326d016a05c594b8cd2f19effe792c23fde3ef 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/util.c: Call process_signals only when color_context is not
RESET_CONTEXT.

Reported by Gisle Vanem in http://debbugs.gnu.org/22067
---
 src/util.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/util.c b/src/util.c
index bf9ed97..26615ca 100644
--- a/src/util.c
+++ b/src/util.c
@@ -1349,7 +1349,8 @@ static enum color_context last_context = RESET_CONTEXT;
 void
 set_color_context (enum color_context color_context)
 {
-  process_signals ();
+  if (color_context != RESET_CONTEXT)
+    process_signals ();
   if (colors_enabled && last_context != color_context)
     {
       put_indicator (&color_indicator[C_LEFT]);
-- 
2.5.0


This bug report was last modified 9 years and 69 days ago.

Previous Next


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