[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug#582083: patch for grep --color to non-tty output
From: |
Aníbal Monsalve Salazar |
Subject: |
Re: Bug#582083: patch for grep --color to non-tty output |
Date: |
Tue, 24 Apr 2012 13:50:40 +1000 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Tue, Apr 24, 2012 at 01:20:15PM +1000, Tim Connors wrote:
>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
Hello Tim,
Sure. Cc-ing Jim and bug-grep.
Debian bug report is posted at:
http://bugs.debian.org/582083
>and apply it in debian (with appropriate fuzzing)[1] please?
Let's see if Jim takes it.
>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
Thanks,
Anibal
- Re: Bug#582083: patch for grep --color to non-tty output,
Aníbal Monsalve Salazar <=