revert 2002 change that removed "Binary " from "files A and B differ"

With this change, "printf '\0'|diff - /dev/null" now prints
"Binary files - and /dev/null differ" once again.
This reverts 2002-06-28 commit a352f0980,
"(briefly_report): Don't say "Binary files differ", ...".
* src/analyze.c (briefly_report): Do include the "Binary " prefix
in the diagnostic, when !brief.
* NEWS (Changes in behavior): Mention the diagnostic change.
Reported by Andreas Hoenen in http://bugs.debian.org/570064.
This commit is contained in:
Jim Meyering 2010-02-18 12:59:29 +01:00
parent aa56d5f6d0
commit 3f591f4bb5
2 changed files with 15 additions and 3 deletions

7
NEWS
View File

@ -2,6 +2,13 @@ GNU diffutils NEWS -*- outline -*-
* Noteworthy changes in release ?.? (????-??-??) [?]
** Changes in behavior
diff once again reports a difference with the diagnostic
"Binary files A and B differ" when at least one of the files
appears to be binary. From 2.8.4 through diffutils-2.9, it printed
"Files A and B differ".
* Noteworthy changes in release 2.9 (2010-02-11) [stable]

View File

@ -454,9 +454,14 @@ briefly_report (int changes, struct file_data const filevec[])
{
char const *label0 = file_label[0] ? file_label[0] : filevec[0].name;
char const *label1 = file_label[1] ? file_label[1] : filevec[1].name;
message ("Files %s and %s differ\n", label0, label1);
if (! brief)
changes = 2;
if (brief)
message ("Files %s and %s differ\n", label0, label1);
else
{
message ("Binary files %s and %s differ\n", label0, label1);
changes = 2;
}
}
return changes;