From 3633e3aa59f8df4e12f1b509c952e17dbf205819 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Sun, 11 Dec 2011 21:08:51 +0900 Subject: [PATCH] coding.c (Funencodable_char_position): Pay attention to the buffer text relocation (Bug#9389). --- src/ChangeLog | 5 +++++ src/coding.c | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 20fd021a376..221ba913a80 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-12-11 Kenichi Handa + + * coding.c (Funencodable_char_position): Pay attention to the + buffer text relocation (Bug#9389). + 2011-12-10 Jan Djärv * xterm.c (x_term_init): Move call to gdk_window_add_filter before diff --git a/src/coding.c b/src/coding.c index 50268099413..e15d725af3a 100644 --- a/src/coding.c +++ b/src/coding.c @@ -8756,6 +8756,7 @@ to the string. */) } positions = Qnil; + charset_map_loaded = 0; while (1) { int c; @@ -8783,6 +8784,16 @@ to the string. */) } from++; + if (charset_map_loaded && NILP (string)) + { + p = CHAR_POS_ADDR (from); + pend = CHAR_POS_ADDR (to); + if (from < GPT && to >= GPT) + stop = GPT_ADDR; + else + stop = pend; + charset_map_loaded = 0; + } } return (NILP (count) ? Fcar (positions) : Fnreverse (positions)); -- 2.39.2