On Tuesday, 08.01.2008 at 20:40 +0100, Adeodato Simó wrote:

> * Dave Ewart [Tue, 08 Jan 2008 19:16:14 +0000]:
> 
> > Are you perhaps suggesting that it should detect the extra parameter
> > '-u' and ignore it when working as a pipe?
> 
> Yeah, I mentioned this in my follow-up mail. If colordiff is a drop-in
> diff replacement that *also* acts as a filter, then it should smartly
> detect when the user wants it to behave as a filter. Do you see what I
> mean? For that, the two possible schemes I mentioned in my other mail.

Does applying the following patch help?  I've not tested it fully, but
if might be sufficient.  You will need to patch /usr/bin/colordiff or a
copy of it elsewhere.

--- colordiff.pl.orig   2008-01-16 20:24:06.000000000 +0000
+++ colordiff.pl        2008-01-16 20:28:08.000000000 +0000
@@ -163,7 +163,7 @@
 
 my @inputstream;
 
-if (defined $ARGV[0]) {
+if ((defined $ARGV[0]) && (-t STDIN)) {
     # More reliable way of pulling in arguments
     open2(\*INPUTSTREAM, undef, "diff", @ARGV);
     @inputstream = <INPUTSTREAM>;

Dave.
-- 
Dave Ewart [EMAIL PROTECTED], jabber:[EMAIL PROTECTED], freenode:davee
All email from me is now digitally signed, http://www.sungate.co.uk/
Fingerprint: AEC5 9360 0A35 7F66 66E9 82E4 9E10 6769 CD28 DA92

Attachment: signature.asc
Description: Digital signature

Reply via email to