wok annotate busybox/stuff/busybox-1.25-diff.u @ rev 19597

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