diff options
Diffstat (limited to 'editors/diff.c')
-rw-r--r-- | editors/diff.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/editors/diff.c b/editors/diff.c index 91109821e..2e3a455f7 100644 --- a/editors/diff.c +++ b/editors/diff.c | |||
@@ -432,7 +432,8 @@ static NOINLINE int *create_J(FILE_and_pos_t ft[2], int nlen[2], off_t *ix[2]) | |||
432 | token_t tok; | 432 | token_t tok; |
433 | size_t sz = 100; | 433 | size_t sz = 100; |
434 | nfile[i] = xmalloc((sz + 3) * sizeof(nfile[i][0])); | 434 | nfile[i] = xmalloc((sz + 3) * sizeof(nfile[i][0])); |
435 | fseeko(ft[i].ft_fp, 0, SEEK_SET); /* ft gets here without the correct position */ | 435 | /* ft gets here without the correct position, cant use seek_ft */ |
436 | fseeko(ft[i].ft_fp, 0, SEEK_SET); | ||
436 | 437 | ||
437 | nlen[i] = 0; | 438 | nlen[i] = 0; |
438 | /* We could zalloc nfile, but then zalloc starts showing in gprof at ~1% */ | 439 | /* We could zalloc nfile, but then zalloc starts showing in gprof at ~1% */ |
@@ -625,7 +626,7 @@ static bool diff(FILE* fp[2], char *file[2]) | |||
625 | } | 626 | } |
626 | if (idx < 0) | 627 | if (idx < 0) |
627 | continue; | 628 | continue; |
628 | if (!(option_mask32 & FLAG(q)) && !((option_mask32 & FLAG(B)) && !nonempty)) { | 629 | if (!(option_mask32 & (FLAG(q)+FLAG(B))) && !nonempty) { |
629 | struct context_vec *cvp = vec; | 630 | struct context_vec *cvp = vec; |
630 | int lowa = MAX(1, cvp->a - opt_U_context); | 631 | int lowa = MAX(1, cvp->a - opt_U_context); |
631 | int upb = MIN(nlen[0], vec[idx].b + opt_U_context); | 632 | int upb = MIN(nlen[0], vec[idx].b + opt_U_context); |
@@ -634,8 +635,8 @@ static bool diff(FILE* fp[2], char *file[2]) | |||
634 | 635 | ||
635 | if (!anychange) { | 636 | if (!anychange) { |
636 | /* Print the context/unidiff header first time through */ | 637 | /* Print the context/unidiff header first time through */ |
637 | printf("--- %s\n", label[0] ?: file[0]); | 638 | printf("--- %s\n", label[0] ? label[0] : file[0]); |
638 | printf("+++ %s\n", label[1] ?: file[1]); | 639 | printf("+++ %s\n", label[1] ? label[1] : file[1]); |
639 | } | 640 | } |
640 | 641 | ||
641 | printf("@@ -"); | 642 | printf("@@ -"); |