wok-undigest diff busybox/stuff/busybox-1.22-diff.u @ rev 1138
Add busybox with "# CONFIG_FEATURE_EDITING_SAVE_ON_EXIT is not set"
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Fri Jan 16 02:51:58 2015 +0200 (2015-01-16) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/busybox/stuff/busybox-1.22-diff.u Fri Jan 16 02:51:58 2015 +0200 1.3 @@ -0,0 +1,17 @@ 1.4 +--- busybox-1.20.0/editors/diff.c 1.5 ++++ busybox-1.20.0/editors/diff.c 1.6 +@@ -756,6 +756,14 @@ 1.7 + j = fread(buf1, 1, sz, fp[1]); 1.8 + if (i != j) { 1.9 + differ = true; 1.10 ++ /* Ensure we detect binary file even if a file is empty or very 1.11 ++ short. */ 1.12 ++ for (k = 0; k < i; k++) 1.13 ++ if (!buf0[k]) 1.14 ++ binary = true; 1.15 ++ for (k = 0; k < j; k++) 1.16 ++ if (!buf1[k]) 1.17 ++ binary = true; 1.18 + i = MIN(i, j); 1.19 + } 1.20 + if (i == 0)