From d704470f14a59d218aaf843f01ce4e0b1af4ea82 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Fri, 26 Dec 2008 14:43:21 +0000 Subject: [PATCH] (map_keymap_char_table_item): Make a copy of KEY if it is a cons. --- src/ChangeLog | 5 +++++ src/keymap.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 4d4a7a51b20..804e703eadd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2008-12-26 Andreas Schwab + + * keymap.c (map_keymap_char_table_item): Make a copy of KEY if it is a + cons. + 2008-12-26 Martin Rudalics * textprop.c (Qminibuffer_prompt): New variable. diff --git a/src/keymap.c b/src/keymap.c index 753d1991a3e..81ef32ed939 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -650,6 +650,10 @@ map_keymap_char_table_item (args, key, val) { map_keymap_function_t fun = XSAVE_VALUE (XCAR (args))->pointer; args = XCDR (args); + /* If the key is a range, make a copy since map_char_table modifies + it in place. */ + if (CONSP (key)) + key = Fcons (XCAR (key), XCDR (key)); map_keymap_item (fun, XCDR (args), key, val, XSAVE_VALUE (XCAR (args))->pointer); } -- 2.39.2