Subject: Re: [bug-diffutils] bug#17075: diff - - exits immediately

From: Paul Eggert <[email-masked]>
Date: Mon, 24 Mar 2014 17:06:05 -0700

Karl Berry wrote:
> Couldn't there be side effects missed by not reading the input?

Sure, but the invoker shouldn't rely on those side effects, from 'diff' 
or from 'cmp' or from 'head' or from any other program that need not 
read all its input.

> Perhaps the help message could get a one-line addition:

Unfortunately all the one-liners I can think of are wrong.  For example, 
diff must read all its input even when given two identical file names A 
and A, e.g., if it's also given the -DFOO option.  And even without 
-DFOO, 'diff A A' reports an error if A does not exist.

Another amusing example: 'diff A A' can succeed even if A is unreadable:

$ umask 777
$ echo foo >A
$ ls -l A
---------- 1 eggert eggert 4 Mar 24 17:02 A
$ diff A A
$ echo $?
0