wok view busybox/stuff/busybox-1.30-diff.u @ rev 21309
1) libfm-extra: fix build while using development sources
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Thu Apr 18 17:17:32 2019 +0300 (2019-04-18) |
parents | |
children |
line source
1 --- busybox-1.30/editors/diff.c
2 +++ busybox-1.30/editors/diff.c
3 @@ -109,6 +109,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 @@ -140,6 +141,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 @@ -754,6 +756,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 @@ -867,7 +877,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 @@ -982,7 +994,7 @@
46 INIT_G();
48 /* exactly 2 params; collect multiple -L <label>; -U N */
49 - GETOPT32(argv, "^" "abdiL:*NqrsS:tTU:+wupBE" "\0" "=2"
50 + GETOPT32(argv, "^" "abdilL:*NqrsS:tTU:+wupBE" "\0" "=2"
51 LONGOPTS,
52 &L_arg, &s_start, &opt_U_context);
53 argv += optind;