diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/editfns.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/editfns.c b/src/editfns.c index d648fd24f7d..f6f30ee99a2 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -2425,6 +2425,7 @@ It returns the number of characters changed.") | |||
| 2425 | int cnt; /* Number of changes made. */ | 2425 | int cnt; /* Number of changes made. */ |
| 2426 | int size; /* Size of translate table. */ | 2426 | int size; /* Size of translate table. */ |
| 2427 | int pos; | 2427 | int pos; |
| 2428 | int multibyte = !NILP (current_buffer->enable_multibyte_characters); | ||
| 2428 | 2429 | ||
| 2429 | validate_region (&start, &end); | 2430 | validate_region (&start, &end); |
| 2430 | CHECK_STRING (table, 2); | 2431 | CHECK_STRING (table, 2); |
| @@ -2445,7 +2446,10 @@ It returns the number of characters changed.") | |||
| 2445 | int oc; | 2446 | int oc; |
| 2446 | int pos_byte_next; | 2447 | int pos_byte_next; |
| 2447 | 2448 | ||
| 2448 | oc = STRING_CHAR_AND_LENGTH (p, stop - pos_byte, len); | 2449 | if (multibyte) |
| 2450 | oc = STRING_CHAR_AND_LENGTH (p, stop - pos_byte, len); | ||
| 2451 | else | ||
| 2452 | oc = *p, len = 1; | ||
| 2449 | pos_byte_next = pos_byte + len; | 2453 | pos_byte_next = pos_byte + len; |
| 2450 | if (oc < size && len == 1) | 2454 | if (oc < size && len == 1) |
| 2451 | { | 2455 | { |