wok-6.x view busybox/stuff/busybox-1.25-diff.u @ rev 19568

Up qt4 (4.8.7)
author Xander Ziiryanoff <psychomaniak@xakep.ru>
date Thu Dec 22 15:11:17 2016 +0100 (2016-12-22)
parents
children
line source
1 --- busybox-1.25/editors/diff.c
2 +++ busybox-1.25/editors/diff.c
3 @@ -113,6 +113,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 @@ -144,6 +145,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 @@ -759,6 +761,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 @@ -872,7 +882,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 @@ -986,7 +998,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)