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

From: [email-masked] (Karl Berry)
Date: Mon, 24 Mar 2014 18:10:19 GMT

diff A A

Couldn't there be side effects missed by not reading the input?
E.g., if stdin is a pipe, or maybe a named pipes, or special
file.  Doesn't seem equivalent to regular files to me, as Eric says.

Anyway, I won't argue for a change in behavior.  I was just surprised
that stdin was not read at all.  Perhaps the help message could get a
one-line addition:

< If a FILE is '-', read standard input.
-
> If a FILE is '-', read standard input.
> If FILES are identical strings, nothing is read.

Not sure that's exactly right, but it's the best my brain can do right now.

The manual explicitly says:
    As a special case, `diff - -' compares a copy of standard input to
    itself.
That does not seem accurate to me (perhaps it was once).  It doesn't
read stdin at all, it just exits zero immediately.

Not that any of this is a big deal, of course.

thanks,
karl