diff options
Diffstat (limited to 'editors/diff.c')
-rw-r--r-- | editors/diff.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/editors/diff.c b/editors/diff.c index 093e7b498..a1c51ebb9 100644 --- a/editors/diff.c +++ b/editors/diff.c | |||
@@ -824,11 +824,11 @@ struct dlist { | |||
824 | }; | 824 | }; |
825 | 825 | ||
826 | /* This function adds a filename to dl, the directory listing. */ | 826 | /* This function adds a filename to dl, the directory listing. */ |
827 | static int FAST_FUNC add_to_dirlist(const char *filename, | 827 | static int FAST_FUNC add_to_dirlist(struct recursive_state *state, |
828 | struct stat *sb UNUSED_PARAM, | 828 | const char *filename, |
829 | void *userdata, int depth UNUSED_PARAM) | 829 | struct stat *sb UNUSED_PARAM) |
830 | { | 830 | { |
831 | struct dlist *const l = userdata; | 831 | struct dlist *const l = state->userData; |
832 | const char *file = filename + l->len; | 832 | const char *file = filename + l->len; |
833 | while (*file == '/') | 833 | while (*file == '/') |
834 | file++; | 834 | file++; |
@@ -841,12 +841,12 @@ static int FAST_FUNC add_to_dirlist(const char *filename, | |||
841 | /* If recursion is not set, this function adds the directory | 841 | /* If recursion is not set, this function adds the directory |
842 | * to the list and prevents recursive_action from recursing into it. | 842 | * to the list and prevents recursive_action from recursing into it. |
843 | */ | 843 | */ |
844 | static int FAST_FUNC skip_dir(const char *filename, | 844 | static int FAST_FUNC skip_dir(struct recursive_state *state, |
845 | struct stat *sb, void *userdata, | 845 | const char *filename, |
846 | int depth) | 846 | struct stat *sb) |
847 | { | 847 | { |
848 | if (!(option_mask32 & FLAG(r)) && depth) { | 848 | if (!(option_mask32 & FLAG(r)) && state->depth) { |
849 | add_to_dirlist(filename, sb, userdata, depth); | 849 | add_to_dirlist(state, filename, sb); |
850 | return SKIP; | 850 | return SKIP; |
851 | } | 851 | } |
852 | if (!(option_mask32 & FLAG(N))) { | 852 | if (!(option_mask32 & FLAG(N))) { |
@@ -854,7 +854,7 @@ static int FAST_FUNC skip_dir(const char *filename, | |||
854 | * which do not exist on the "other side". | 854 | * which do not exist on the "other side". |
855 | * Testcase: diff -r /tmp / | 855 | * Testcase: diff -r /tmp / |
856 | * (it would recurse deep into /proc without this code) */ | 856 | * (it would recurse deep into /proc without this code) */ |
857 | struct dlist *const l = userdata; | 857 | struct dlist *const l = state->userData; |
858 | filename += l->len; | 858 | filename += l->len; |
859 | if (filename[0]) { | 859 | if (filename[0]) { |
860 | struct stat osb; | 860 | struct stat osb; |
@@ -889,7 +889,7 @@ static void diffdir(char *p[2], const char *s_start) | |||
889 | * add_to_dirlist will remove it. */ | 889 | * add_to_dirlist will remove it. */ |
890 | list[i].len = strlen(p[i]); | 890 | list[i].len = strlen(p[i]); |
891 | recursive_action(p[i], ACTION_RECURSE | ACTION_FOLLOWLINKS, | 891 | recursive_action(p[i], ACTION_RECURSE | ACTION_FOLLOWLINKS, |
892 | add_to_dirlist, skip_dir, &list[i], 0); | 892 | add_to_dirlist, skip_dir, &list[i]); |
893 | /* Sort dl alphabetically. | 893 | /* Sort dl alphabetically. |
894 | * GNU diff does this ignoring any number of trailing dots. | 894 | * GNU diff does this ignoring any number of trailing dots. |
895 | * We don't, so for us dotted files almost always are | 895 | * We don't, so for us dotted files almost always are |