Package: colordiff
Version: 1.0.7-2
Severity: normal
Tags: patch

If one writes a shell fragment like: 
find . -type f | while read a ; do colordiff -u "$a" 
/home/aatlxz/twc/public_html/"$a" ; done

then colordiff tries to slurp all of find's stdout, rather than
letting the shell slurp it.

The reason is simple, and I'm wondering whether the following patch is
desired.  This doesn't seem to break regular colordiff operation where
both filenames are supplied, and when it is taking as stdin input, the
output from another diff run.  If no arg is supplied, and the terminal
is stdin, then diff runs regardless, offering the --help output as
expected.

RCS file: /home/ssi/tconnors/cvsroot/bin/colordiff,v
retrieving revision 1.7
diff -u -b -r1.7 colordiff
--- colordiff   4 May 2008 22:53:41 -0000       1.7
+++ colordiff   28 Jan 2009 03:01:57 -0000
@@ -165,9 +165,10 @@
 my @inputstream;
 
 my $exitcode=0;
-if ((defined $ARGV[0]) && (-t STDIN)) {
+if ((defined $ARGV[0]) || (-t STDIN)) {
     # More reliable way of pulling in arguments
     my $pid = open2(\*INPUTSTREAM, undef, "diff", @ARGV);


(This patch applies against the previous patch I supplied in #470835)

-- System Information:
Debian Release: 5.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26 (SMP w/2 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages colordiff depends on:
ii  perl                          5.10.0-19  Larry Wall's Practical Extraction 

colordiff recommends no packages.

colordiff suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to