[PATCH] diff: identify binary files in status

Marc Vertes via busybox <[email protected]>
Newsgroups gmane.linux.busybox
Message-ID <[email protected]>
This change allows to identify binary files in recursive or
unified diffs, with the same output as BSD and GNU diff.
---
 editors/diff.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/editors/diff.c b/editors/diff.c
index 6f4ed9712..68e17e0e6 100644
--- a/editors/diff.c
+++ b/editors/diff.c
@@ -784,8 +784,10 @@ static void print_status(int status, char *path[2])
 {
 	switch (status) {
 	case STATUS_BINARY:
+		 printf("Binary files %s and %s differ\n", path[0], path[1]);
+		 break;
 	case STATUS_DIFFER:
-		if ((option_mask32 & FLAG(q)) || status == STATUS_BINARY)
+		if (option_mask32 & FLAG(q))
 			printf("Files %s and %s differ\n", path[0], path[1]);
 		break;
 	case STATUS_SAME:
-- 
2.52.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.