read_key_sequence: correct the handling of raw_keybuf in recursive calls
commit5b5f441ff8986800aa5f175bb5db2dd90e642a3a
authorAlan Mackenzie <acm@muc.de>
Mon, 20 Nov 2017 18:05:33 +0000 (20 18:05 +0000)
committerAlan Mackenzie <acm@muc.de>
Mon, 20 Nov 2017 18:08:43 +0000 (20 18:08 +0000)
treef293bf9b7af092d518185b680e1522c9899b8d61
parent9c6791afcd2b60f069494031ef64a5aac70ca3f8
read_key_sequence: correct the handling of raw_keybuf in recursive calls

This fixes bug #29349.

* src/keyboard.c (raw_keybuf_buffer, raw_keybuf_count_buffer): New variables
pointed to by ...
(raw_keybuf, raw_keybuf_count): Variables converted to pointers.
(GROW_RAW_KEYBUF): enhance with a length argument.
(command_loop_1): Initialize the above two pointers to their canonical values.

(read_key_sequence): In recursive calls (for menus) the function was
overwriting the raw event buffer of the outer call.  Correct this by
introducing a local buffer for each level of call, and setting this up to be
used by the call to read_char.  Any contents of this local buffer are appended
to the global buffer afterwards.
src/keyboard.c