From: Eli Zaretskii Date: Sat, 7 Jan 2012 11:57:48 +0000 (+0200) Subject: Fix bug #6540 with a crash while inserting non-ASCII text under cache-long-line-scans. X-Git-Tag: emacs-pretest-24.0.93~97^2~55^2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6c1bd3f369c39aac648b085c5e9e4e9b42c65c62;p=emacs.git 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) --- diff --git a/src/ChangeLog b/src/ChangeLog index 3e0eed38cfb..f7acc826a49 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-01-07 Eli Zaretskii + + * search.c (scan_buffer): Pass character positions to + know_region_cache, not byte positions. (Bug#6540) + 2012-01-07 LynX <_LynX@bk.ru> (tiny change) * 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, the region from start to cursor is free of them. */ if (target == '\n' && newline_cache) know_region_cache (current_buffer, newline_cache, - start_byte + scan_start - base, - start_byte + cursor - base); + BYTE_TO_CHAR (start_byte + scan_start - base), + BYTE_TO_CHAR (start_byte + cursor - base)); /* Did we find the target character? */ if (cursor < ceiling_addr) @@ -791,8 +791,8 @@ scan_buffer (register int target, EMACS_INT start, EMACS_INT end, the region from after the cursor to start is free of them. */ if (target == '\n' && newline_cache) know_region_cache (current_buffer, newline_cache, - start_byte + cursor - base, - start_byte + scan_start - base); + BYTE_TO_CHAR (start_byte + cursor - base), + BYTE_TO_CHAR (start_byte + scan_start - base)); /* Did we find the target character? */ if (cursor >= ceiling_addr)