wok rev 18269

busybox/diff: add -l support (ignore links)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Aug 06 16:47:14 2015 +0200 (2015-08-06)
parents 4834e7392dfa
children 5df42bcd4a8b
files busybox/stuff/busybox-1.23-diff.u
line diff
     1.1 --- a/busybox/stuff/busybox-1.23-diff.u	Thu Aug 06 15:43:00 2015 +0300
     1.2 +++ b/busybox/stuff/busybox-1.23-diff.u	Thu Aug 06 16:47:14 2015 +0200
     1.3 @@ -1,5 +1,21 @@
     1.4  --- busybox-1.23.0/editors/diff.c
     1.5  +++ busybox-1.23.0/editors/diff.c
     1.6 +@@ -113,6 +113,7 @@
     1.7 + //usage:     "\n	-B	Ignore changes whose lines are all blank"
     1.8 + //usage:     "\n	-d	Try hard to find a smaller set of changes"
     1.9 + //usage:     "\n	-i	Ignore case differences"
    1.10 ++//usage:     "\n	-l	Ignore symbolic links"
    1.11 + //usage:     "\n	-L	Use LABEL instead of the filename in the unified header"
    1.12 + //usage:     "\n	-N	Treat absent files as empty"
    1.13 + //usage:     "\n	-q	Output only whether files differ"
    1.14 +@@ -143,6 +144,7 @@
    1.15 + 	FLAG_b,
    1.16 + 	FLAG_d,
    1.17 + 	FLAG_i,
    1.18 ++	FLAG_l,
    1.19 + 	FLAG_L,         /* never used, handled by getopt32 */
    1.20 + 	FLAG_N,
    1.21 + 	FLAG_q,
    1.22  @@ -756,6 +756,14 @@
    1.23   		j = fread(buf1, 1, sz, fp[1]);
    1.24   		if (i != j) {
    1.25 @@ -15,3 +31,23 @@
    1.26   			i = MIN(i, j);
    1.27   		}
    1.28   		if (i == 0)
    1.29 +@@ -877,7 +887,9 @@
    1.30 + 		 * Using list.len to specify its length,
    1.31 + 		 * add_to_dirlist will remove it. */
    1.32 + 		list[i].len = strlen(p[i]);
    1.33 +-		recursive_action(p[i], ACTION_RECURSE | ACTION_FOLLOWLINKS,
    1.34 ++		recursive_action(p[i],
    1.35 ++				(option_mask32 & FLAG(l)) ? ACTION_RECURSE :
    1.36 ++				ACTION_RECURSE | ACTION_FOLLOWLINKS,
    1.37 + 				add_to_dirlist, skip_dir, &list[i], 0);
    1.38 + 		/* Sort dl alphabetically.
    1.39 + 		 * GNU diff does this ignoring any number of trailing dots.
    1.40 +@@ -991,7 +1003,7 @@
    1.41 + #if ENABLE_FEATURE_DIFF_LONG_OPTIONS
    1.42 + 	applet_long_options = diff_longopts;
    1.43 + #endif
    1.44 +-	getopt32(argv, "abdiL:NqrsS:tTU:wupBE",
    1.45 ++	getopt32(argv, "abdilL:NqrsS:tTU:wupBE",
    1.46 + 			&L_arg, &s_start, &opt_U_context);
    1.47 + 	argv += optind;
    1.48 + 	while (L_arg)