wok-4.x rev 12135
Fix busybox diff: don't output binary content
author | Antoine Bodin <gokhlayeh@slitaz.org> |
---|---|
date | Tue Mar 13 21:24:32 2012 +0100 (2012-03-13) |
parents | cba3722453f5 |
children | 571f81350c8e |
files | busybox/receipt busybox/stuff/busybox-1.18-diff.u |
line diff
1.1 --- a/busybox/receipt Tue Mar 13 21:06:51 2012 +0100 1.2 +++ b/busybox/receipt Tue Mar 13 21:24:32 2012 +0100 1.3 @@ -32,6 +32,7 @@ 1.4 httpd.u 1.5 su-nochdir.u 1.6 tftp-chroot.u 1.7 +diff.u 1.8 EOT 1.9 cp $stuff/$PACKAGE-${VERSION%.*}.config .config 1.10 }
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/busybox/stuff/busybox-1.18-diff.u Tue Mar 13 21:24:32 2012 +0100 2.3 @@ -0,0 +1,17 @@ 2.4 +--- busybox-1.18.4/editors/diff.c 2.5 ++++ busybox-1.18.4/editors/diff.c 2.6 +@@ -706,6 +706,14 @@ 2.7 + j = fread(buf1, 1, sz, fp[1]); 2.8 + if (i != j) { 2.9 + differ = true; 2.10 ++ /* Ensure we detect binary file even if a file is empty or very 2.11 ++ short. */ 2.12 ++ for (k = 0; k < i; k++) 2.13 ++ if (!buf0[k]) 2.14 ++ binary = true; 2.15 ++ for (k = 0; k < j; k++) 2.16 ++ if (!buf1[k]) 2.17 ++ binary = true; 2.18 + i = MIN(i, j); 2.19 + } 2.20 + if (i == 0)