wok-current annotate busybox/stuff/busybox-1.31-diff.u @ rev 21779

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