bug-diffutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-diffutils] [PATCH] revert 2002 change that removed "Binary " from "


From: Jim Meyering
Subject: [bug-diffutils] [PATCH] revert 2002 change that removed "Binary " from "files A and B differ"
Date: Tue, 23 Feb 2010 09:31:02 +0100

FYI, I've pushed this:

>From 3f591f4bb5776b4fc91573b940a9d845458cc617 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Thu, 18 Feb 2010 12:59:29 +0100
Subject: [PATCH] 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.
---
 NEWS          |    7 +++++++
 src/analyze.c |   11 ++++++++---
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index 0e42975..569c4ef 100644
--- a/NEWS
+++ b/NEWS
@@ -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]

diff --git a/src/analyze.c b/src/analyze.c
index 0a18334..e797248 100644
--- a/src/analyze.c
+++ b/src/analyze.c
@@ -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;
--
1.7.0.367.g566c3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]