wok annotate busybox/stuff/busybox-1.28-diff.u @ rev 20205

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