wok diff busybox/stuff/busybox-1.31-diff.u @ rev 21937
Up nnn (2.7)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Oct 07 18:30:01 2019 +0200 (2019-10-07) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/busybox/stuff/busybox-1.31-diff.u Mon Oct 07 18:30:01 2019 +0200 1.3 @@ -0,0 +1,53 @@ 1.4 +--- busybox-1.31/editors/diff.c 1.5 ++++ busybox-1.31/editors/diff.c 1.6 +@@ -109,6 +109,7 @@ 1.7 + //usage: "\n -B Ignore changes whose lines are all blank" 1.8 + //usage: "\n -d Try hard to find a smaller set of changes" 1.9 + //usage: "\n -i Ignore case differences" 1.10 ++//usage: "\n -l Ignore symbolic links" 1.11 + //usage: "\n -L Use LABEL instead of the filename in the unified header" 1.12 + //usage: "\n -N Treat absent files as empty" 1.13 + //usage: "\n -q Output only whether files differ" 1.14 +@@ -140,6 +141,7 @@ 1.15 + FLAG_b, 1.16 + FLAG_d, 1.17 + FLAG_i, 1.18 ++ FLAG_l, 1.19 + FLAG_L, /* never used, handled by getopt32 */ 1.20 + FLAG_N, 1.21 + FLAG_q, 1.22 +@@ -754,6 +756,14 @@ 1.23 + j = fread(buf1, 1, sz, fp[1]); 1.24 + if (i != j) { 1.25 + differ = true; 1.26 ++ /* Ensure we detect binary file even if a file is empty or very 1.27 ++ short. */ 1.28 ++ for (k = 0; k < i; k++) 1.29 ++ if (!buf0[k]) 1.30 ++ binary = true; 1.31 ++ for (k = 0; k < j; k++) 1.32 ++ if (!buf1[k]) 1.33 ++ binary = true; 1.34 + i = MIN(i, j); 1.35 + } 1.36 + if (i == 0) 1.37 +@@ -867,7 +877,9 @@ 1.38 + * Using list.len to specify its length, 1.39 + * add_to_dirlist will remove it. */ 1.40 + list[i].len = strlen(p[i]); 1.41 +- recursive_action(p[i], ACTION_RECURSE | ACTION_FOLLOWLINKS, 1.42 ++ recursive_action(p[i], 1.43 ++ (option_mask32 & FLAG(l)) ? ACTION_RECURSE : 1.44 ++ ACTION_RECURSE | ACTION_FOLLOWLINKS, 1.45 + add_to_dirlist, skip_dir, &list[i], 0); 1.46 + /* Sort dl alphabetically. 1.47 + * GNU diff does this ignoring any number of trailing dots. 1.48 +@@ -982,7 +994,7 @@ 1.49 + INIT_G(); 1.50 + 1.51 + /* exactly 2 params; collect multiple -L <label>; -U N */ 1.52 +- GETOPT32(argv, "^" "abdiL:*NqrsS:tTU:+wupBE" "\0" "=2" 1.53 ++ GETOPT32(argv, "^" "abdilL:*NqrsS:tTU:+wupBE" "\0" "=2" 1.54 + LONGOPTS, 1.55 + &L_arg, &s_start, &opt_U_context); 1.56 + argv += optind;