diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2014-01-31 17:15:26 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2014-01-31 17:15:54 -0800 |
commit | bc4b4b2bbf699267bab167af0484336780791953 (patch) | |
tree | f559a250090596a0a77361e86c271bb04fd1427e /doc | |
parent | 1875453ee6e1021d67c6856c46e7024bcecdbea8 (diff) | |
download | diffutils-bc4b4b2bbf699267bab167af0484336780791953.tar.gz |
diff: exit with status 1, not 2, when binary files differ
Problem reported by Vincent Lefevre in <http://bugs.gnu.org/16608>.
* NEWS:
* doc/diffutils.texi (Binary, Invoking diff): Document this.
* src/analyze.c (briefly_report): Return void, not int.
All uses changed. Do not futz with exit status. Simplify.
* tests/binary: Adjust to match new behavior.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/diffutils.texi | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/doc/diffutils.texi b/doc/diffutils.texi index 2d238dc..1d48f54 100644 --- a/doc/diffutils.texi +++ b/doc/diffutils.texi @@ -426,6 +426,8 @@ binary (a non-text file), it normally treats that pair of files much as if the summary output format had been selected (@pxref{Brief}), and reports only that the binary files are different. This is because line by line comparisons are usually not meaningful for binary files. +This does not count as trouble, even though the resulting output does +not capture all the differences. @command{diff} determines whether a file is text or binary by checking the first few bytes in the file; the exact number of bytes is system @@ -450,14 +452,6 @@ You can also force @command{diff} to report only whether files differ (but not how). Use the @option{--brief} (@option{-q}) option for this. -Normally, differing binary files count as trouble because the -resulting @command{diff} output does not capture all the differences. -This trouble causes @command{diff} to exit with status 2. However, -this trouble cannot occur with the @option{--text} (@option{-a}) -option, or with the @option{--brief} (@option{-q}) option, as these -options both cause @command{diff} to generate a form of output that -represents differences as requested. - In operating systems that distinguish between text and binary files, @command{diff} normally reads and writes all data as text. Use the @option{--binary} option to force @command{diff} to read and write binary @@ -3705,10 +3699,7 @@ argument by itself treats the remaining arguments as file names even if they begin with @samp{-}. An exit status of 0 means no differences were found, 1 means some -differences were found, and 2 means trouble. Normally, differing -binary files count as trouble, but this can be altered by using the -@option{--text} (@option{-a}) option, or the @option{-q} or -@option{--brief} option. +differences were found, and 2 means trouble. @menu * diff Options:: Summary of options to @command{diff}. |