diff options
| author | Eli Zaretskii | 2012-01-07 13:57:48 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2012-01-07 13:57:48 +0200 |
| commit | 6c1bd3f369c39aac648b085c5e9e4e9b42c65c62 (patch) | |
| tree | 8ec70ac4eead11f62ac2bd169bfdc3d7f91e5bdc /src | |
| parent | edd9679c3707f045d8bea911bc657ff367096bc3 (diff) | |
| download | emacs-6c1bd3f369c39aac648b085c5e9e4e9b42c65c62.tar.gz emacs-6c1bd3f369c39aac648b085c5e9e4e9b42c65c62.zip | |
Fix bug #6540 with a crash while inserting non-ASCII text under cache-long-line-scans.
src/search.c (scan_buffer): Pass character positions to
know_region_cache, not byte positions. (Bug#6540)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/search.c | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 3e0eed38cfb..f7acc826a49 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-01-07 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * search.c (scan_buffer): Pass character positions to | ||
| 4 | know_region_cache, not byte positions. (Bug#6540) | ||
| 5 | |||
| 1 | 2012-01-07 LynX <_LynX@bk.ru> (tiny change) | 6 | 2012-01-07 LynX <_LynX@bk.ru> (tiny change) |
| 2 | 7 | ||
| 3 | * w32.c (sys_rename): Report EXDEV when rename of a directory | 8 | * w32.c (sys_rename): Report EXDEV when rename of a directory |
diff --git a/src/search.c b/src/search.c index bb68c89f243..67323b3c6e7 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -725,8 +725,8 @@ scan_buffer (register int target, EMACS_INT start, EMACS_INT end, | |||
| 725 | the region from start to cursor is free of them. */ | 725 | the region from start to cursor is free of them. */ |
| 726 | if (target == '\n' && newline_cache) | 726 | if (target == '\n' && newline_cache) |
| 727 | know_region_cache (current_buffer, newline_cache, | 727 | know_region_cache (current_buffer, newline_cache, |
| 728 | start_byte + scan_start - base, | 728 | BYTE_TO_CHAR (start_byte + scan_start - base), |
| 729 | start_byte + cursor - base); | 729 | BYTE_TO_CHAR (start_byte + cursor - base)); |
| 730 | 730 | ||
| 731 | /* Did we find the target character? */ | 731 | /* Did we find the target character? */ |
| 732 | if (cursor < ceiling_addr) | 732 | if (cursor < ceiling_addr) |
| @@ -791,8 +791,8 @@ scan_buffer (register int target, EMACS_INT start, EMACS_INT end, | |||
| 791 | the region from after the cursor to start is free of them. */ | 791 | the region from after the cursor to start is free of them. */ |
| 792 | if (target == '\n' && newline_cache) | 792 | if (target == '\n' && newline_cache) |
| 793 | know_region_cache (current_buffer, newline_cache, | 793 | know_region_cache (current_buffer, newline_cache, |
| 794 | start_byte + cursor - base, | 794 | BYTE_TO_CHAR (start_byte + cursor - base), |
| 795 | start_byte + scan_start - base); | 795 | BYTE_TO_CHAR (start_byte + scan_start - base)); |
| 796 | 796 | ||
| 797 | /* Did we find the target character? */ | 797 | /* Did we find the target character? */ |
| 798 | if (cursor >= ceiling_addr) | 798 | if (cursor >= ceiling_addr) |