diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/editfns.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/editfns.c b/src/editfns.c index 90022117140..d1a6bfbbb1b 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -3127,6 +3127,9 @@ static unsigned short rbc_quitcounter; | |||
| 3127 | /* Buffers to compare. */ \ | 3127 | /* Buffers to compare. */ \ |
| 3128 | struct buffer *buffer_a; \ | 3128 | struct buffer *buffer_a; \ |
| 3129 | struct buffer *buffer_b; \ | 3129 | struct buffer *buffer_b; \ |
| 3130 | /* BEGV of each buffer */ \ | ||
| 3131 | ptrdiff_t beg_a; \ | ||
| 3132 | ptrdiff_t beg_b; \ | ||
| 3130 | /* Whether each buffer is unibyte/plain-ASCII or not. */ \ | 3133 | /* Whether each buffer is unibyte/plain-ASCII or not. */ \ |
| 3131 | bool a_unibyte; \ | 3134 | bool a_unibyte; \ |
| 3132 | bool b_unibyte; \ | 3135 | bool b_unibyte; \ |
| @@ -3208,6 +3211,8 @@ differences between the two buffers. */) | |||
| 3208 | struct context ctx = { | 3211 | struct context ctx = { |
| 3209 | .buffer_a = a, | 3212 | .buffer_a = a, |
| 3210 | .buffer_b = b, | 3213 | .buffer_b = b, |
| 3214 | .beg_a = min_a, | ||
| 3215 | .beg_b = min_b, | ||
| 3211 | .a_unibyte = BUF_ZV (a) == BUF_ZV_BYTE (a), | 3216 | .a_unibyte = BUF_ZV (a) == BUF_ZV_BYTE (a), |
| 3212 | .b_unibyte = BUF_ZV (b) == BUF_ZV_BYTE (b), | 3217 | .b_unibyte = BUF_ZV (b) == BUF_ZV_BYTE (b), |
| 3213 | .deletions = SAFE_ALLOCA (del_bytes), | 3218 | .deletions = SAFE_ALLOCA (del_bytes), |
| @@ -3349,8 +3354,8 @@ static bool | |||
| 3349 | buffer_chars_equal (struct context *ctx, | 3354 | buffer_chars_equal (struct context *ctx, |
| 3350 | ptrdiff_t pos_a, ptrdiff_t pos_b) | 3355 | ptrdiff_t pos_a, ptrdiff_t pos_b) |
| 3351 | { | 3356 | { |
| 3352 | pos_a += BUF_BEGV (ctx->buffer_a); | 3357 | pos_a += ctx->beg_a; |
| 3353 | pos_b += BUF_BEGV (ctx->buffer_b); | 3358 | pos_b += ctx->beg_b; |
| 3354 | 3359 | ||
| 3355 | /* Allow the user to escape out of a slow compareseq call. */ | 3360 | /* Allow the user to escape out of a slow compareseq call. */ |
| 3356 | rarely_quit (++rbc_quitcounter); | 3361 | rarely_quit (++rbc_quitcounter); |