GNU bug report logs - #17075
diff - - exits immediately

Previous Next

Package: diffutils;

Reported by: karl <at> freefriends.org (Karl Berry)

Date: Sun, 23 Mar 2014 21:22:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: karl <at> freefriends.org (Karl Berry)
To: eggert <at> cs.ucla.edu
Cc: 17075 <at> debbugs.gnu.org
Subject: bug#17075: [bug-diffutils] bug#17075: diff - - exits immediately
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




This bug report was last modified 11 years and 107 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.