diff options
Diffstat (limited to 'coreutils/diff.c')
| -rw-r--r-- | coreutils/diff.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/coreutils/diff.c b/coreutils/diff.c index 17975ad20..b1345f8d0 100644 --- a/coreutils/diff.c +++ b/coreutils/diff.c | |||
| @@ -501,7 +501,7 @@ static int skipline(FILE *f) | |||
| 501 | * to confounding by hashing (which result in "jackpot") | 501 | * to confounding by hashing (which result in "jackpot") |
| 502 | * 2. collect random access indexes to the two files | 502 | * 2. collect random access indexes to the two files |
| 503 | */ | 503 | */ |
| 504 | static void check(char *file1, FILE *f1, char *file2, FILE *f2) | 504 | static void check(FILE *f1, FILE *f2) |
| 505 | { | 505 | { |
| 506 | int i, j, jackpot, c, d; | 506 | int i, j, jackpot, c, d; |
| 507 | long ctold, ctnew; | 507 | long ctold, ctnew; |
| @@ -636,7 +636,7 @@ static void uni_range(int a, int b) | |||
| 636 | printf("%d,0", b); | 636 | printf("%d,0", b); |
| 637 | } | 637 | } |
| 638 | 638 | ||
| 639 | static int fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile) | 639 | static int fetch(long *f, int a, int b, FILE *lb, int ch) |
| 640 | { | 640 | { |
| 641 | int i, j, c, lastc, col, nc; | 641 | int i, j, c, lastc, col, nc; |
| 642 | 642 | ||
| @@ -733,23 +733,23 @@ static void dump_unified_vec(FILE *f1, FILE *f2) | |||
| 733 | 733 | ||
| 734 | switch (ch) { | 734 | switch (ch) { |
| 735 | case 'c': | 735 | case 'c': |
| 736 | fetch(ixold, lowa, a - 1, f1, ' ', 0); | 736 | fetch(ixold, lowa, a - 1, f1, ' '); |
| 737 | fetch(ixold, a, b, f1, '-', 0); | 737 | fetch(ixold, a, b, f1, '-'); |
| 738 | fetch(ixnew, c, d, f2, '+', 0); | 738 | fetch(ixnew, c, d, f2, '+'); |
| 739 | break; | 739 | break; |
| 740 | case 'd': | 740 | case 'd': |
| 741 | fetch(ixold, lowa, a - 1, f1, ' ', 0); | 741 | fetch(ixold, lowa, a - 1, f1, ' '); |
| 742 | fetch(ixold, a, b, f1, '-', 0); | 742 | fetch(ixold, a, b, f1, '-'); |
| 743 | break; | 743 | break; |
| 744 | case 'a': | 744 | case 'a': |
| 745 | fetch(ixnew, lowc, c - 1, f2, ' ', 0); | 745 | fetch(ixnew, lowc, c - 1, f2, ' '); |
| 746 | fetch(ixnew, c, d, f2, '+', 0); | 746 | fetch(ixnew, c, d, f2, '+'); |
| 747 | break; | 747 | break; |
| 748 | } | 748 | } |
| 749 | lowa = b + 1; | 749 | lowa = b + 1; |
| 750 | lowc = d + 1; | 750 | lowc = d + 1; |
| 751 | } | 751 | } |
| 752 | fetch(ixnew, d + 1, upd, f2, ' ', 0); | 752 | fetch(ixnew, d + 1, upd, f2, ' '); |
| 753 | 753 | ||
| 754 | context_vec_ptr = context_vec_start - 1; | 754 | context_vec_ptr = context_vec_start - 1; |
| 755 | } | 755 | } |
| @@ -994,7 +994,7 @@ static int diffreg(char *ofile1, char *ofile2, int flags) | |||
| 994 | 994 | ||
| 995 | ixold = xrealloc(ixold, (len[0] + 2) * sizeof(long)); | 995 | ixold = xrealloc(ixold, (len[0] + 2) * sizeof(long)); |
| 996 | ixnew = xrealloc(ixnew, (len[1] + 2) * sizeof(long)); | 996 | ixnew = xrealloc(ixnew, (len[1] + 2) * sizeof(long)); |
| 997 | check(file1, f1, file2, f2); | 997 | check(f1, f2); |
| 998 | output(file1, f1, file2, f2); | 998 | output(file1, f1, file2, f2); |
| 999 | 999 | ||
| 1000 | closem: | 1000 | closem: |
| @@ -1061,7 +1061,8 @@ static int dir_strcmp(const void *p1, const void *p2) { | |||
| 1061 | 1061 | ||
| 1062 | /* This function adds a filename to dl, the directory listing. */ | 1062 | /* This function adds a filename to dl, the directory listing. */ |
| 1063 | 1063 | ||
| 1064 | static int add_to_dirlist (const char *filename, struct stat *statbuf, void *userdata) { | 1064 | static int add_to_dirlist (const char *filename, |
| 1065 | struct stat ATTRIBUTE_UNUSED *sb, void *userdata) { | ||
| 1065 | dl_count++; | 1066 | dl_count++; |
| 1066 | dl = xrealloc(dl, dl_count * sizeof(char *)); | 1067 | dl = xrealloc(dl, dl_count * sizeof(char *)); |
| 1067 | dl[dl_count - 1] = bb_xstrdup(filename); | 1068 | dl[dl_count - 1] = bb_xstrdup(filename); |
