On Fri, 4 Feb 2011, Tim Connors wrote:

> I imagine this patch fixes it, although I can't seem to compile at all
> right now...
>
> Easy enough to test:
>
> Does 'echo "asd" | grep --color s | cat' show color?
>
> --- main.c.old  2011-02-04 01:58:04.000000000 +1100
> +++ main.c      2011-02-04 02:06:24.000000000 +1100
> @@ -2025,7 +2025,7 @@
>            else
>              show_help = 1;
>          } else
> -          color_option = 2;
> +          color_option = 1;
>          if (color_option == 2)
>           {
>             char const *t;

Could you submit this patch upstream and apply it in debian (with
appropriate fuzzing)[1] please?  There's no reason not to obey the user
when they ask for "--color", regardless of whether the output is to a tty
or not.  They wouldn't have asked for --color if they didn't want it, and
most other gnu programs assume --color=yes rather than --color=auto when
supplied with just --color.  Man and info pages and translations appear to
need to work since they don't imply what the default is.  Nice easy patch
to apply!

[1] New version looks like:
diff -ru grep-2.10//src/main.c /tmp/grep-2.10//src/main.c
--- grep-2.10//src/main.c       2012-04-24 13:11:57.000000000 +1000
+++ /tmp/grep-2.10//src/main.c  2012-04-24 12:56:47.000000000 +1000
@@ -2059,7 +2059,7 @@
           else
             show_help = 1;
         } else
-          color_option = 2;
+          color_option = 1;
         if (color_option == 2)
           {
             char const *t;


-- 
Tim Connors



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to