From a2f904981d10d68bd84b6c7233a79094f052fa8a Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 19 Feb 2015 18:48:39 +0200 Subject: [PATCH] Avoid aborts when input-method-function changes this-command-keys (Bug#19774) src/keyboard.c (read_char): Make sure this_single_command_key_start is in sync with this_command_key_count, around the call to input-method-function. --- src/ChangeLog | 6 ++++++ src/keyboard.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 87133535e97..38af1d83a6d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2015-02-19 Eli Zaretskii + + * keyboard.c (read_char): Make sure this_single_command_key_start + is in sync with this_command_key_count, around the call to + input-method-function. (Bug#19774) + 2015-02-19 Fujii Hironori (tiny change) * w32fns.c (w32_wnd_proc) : Pass the diff --git a/src/keyboard.c b/src/keyboard.c index 4f6a4414a04..ab57553e7d3 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -3034,6 +3034,7 @@ read_char (int commandflag, Lisp_Object map, Lisp_Object keys; ptrdiff_t key_count; bool key_count_reset; + ptrdiff_t command_key_start; struct gcpro gcpro1; ptrdiff_t count = SPECPDL_INDEX (); @@ -3057,6 +3058,7 @@ read_char (int commandflag, Lisp_Object map, /* Save the this_command_keys status. */ key_count = this_command_key_count; key_count_reset = this_command_key_count_reset; + command_key_start = this_single_command_key_start; if (key_count > 0) keys = Fcopy_sequence (this_command_keys); @@ -3067,6 +3069,7 @@ read_char (int commandflag, Lisp_Object map, /* Clear out this_command_keys. */ this_command_key_count = 0; this_command_key_count_reset = 0; + this_single_command_key_start = 0; /* Now wipe the echo area. */ if (!NILP (echo_area_buffer[0])) @@ -3090,6 +3093,7 @@ read_char (int commandflag, Lisp_Object map, and this_command_keys state. */ this_command_key_count = key_count; this_command_key_count_reset = key_count_reset; + this_single_command_key_start = command_key_start; if (key_count > 0) this_command_keys = keys; -- 2.39.2