wok-current view busybox/stuff/busybox-1.27-diff.u @ rev 20486

perl: force arch
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Oct 26 10:09:53 2018 +0200 (2018-10-26)
parents
children
line source
1 --- busybox-1.26/editors/diff.c
2 +++ busybox-1.26/editors/diff.c
3 @@ -111,6 +111,7 @@
4 //usage: "\n -B Ignore changes whose lines are all blank"
5 //usage: "\n -d Try hard to find a smaller set of changes"
6 //usage: "\n -i Ignore case differences"
7 +//usage: "\n -l Ignore symbolic links"
8 //usage: "\n -L Use LABEL instead of the filename in the unified header"
9 //usage: "\n -N Treat absent files as empty"
10 //usage: "\n -q Output only whether files differ"
11 @@ -142,6 +143,7 @@
12 FLAG_b,
13 FLAG_d,
14 FLAG_i,
15 + FLAG_l,
16 FLAG_L, /* never used, handled by getopt32 */
17 FLAG_N,
18 FLAG_q,
19 @@ -756,6 +758,14 @@
20 j = fread(buf1, 1, sz, fp[1]);
21 if (i != j) {
22 differ = true;
23 + /* Ensure we detect binary file even if a file is empty or very
24 + short. */
25 + for (k = 0; k < i; k++)
26 + if (!buf0[k])
27 + binary = true;
28 + for (k = 0; k < j; k++)
29 + if (!buf1[k])
30 + binary = true;
31 i = MIN(i, j);
32 }
33 if (i == 0)
34 @@ -869,7 +879,9 @@
35 * Using list.len to specify its length,
36 * add_to_dirlist will remove it. */
37 list[i].len = strlen(p[i]);
38 - recursive_action(p[i], ACTION_RECURSE | ACTION_FOLLOWLINKS,
39 + recursive_action(p[i],
40 + (option_mask32 & FLAG(l)) ? ACTION_RECURSE :
41 + ACTION_RECURSE | ACTION_FOLLOWLINKS,
42 add_to_dirlist, skip_dir, &list[i], 0);
43 /* Sort dl alphabetically.
44 * GNU diff does this ignoring any number of trailing dots.
45 @@ -983,7 +995,7 @@
46 #if ENABLE_FEATURE_DIFF_LONG_OPTIONS
47 applet_long_options = diff_longopts;
48 #endif
49 - getopt32(argv, "abdiL:*NqrsS:tTU:+wupBE",
50 + getopt32(argv, "abdilL:*NqrsS:tTU:+wupBE",
51 &L_arg, &s_start, &opt_U_context);
52 argv += optind;
53 while (L_arg)