aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1993-05-19 04:58:19 +0000
committerRichard M. Stallman1993-05-19 04:58:19 +0000
commitbb1ef421878a45b3df2cd2ccf96c9b46a881d642 (patch)
treea1df10383a2fb01e1a8f4ba34b24a368ec426a6a /src
parent7260e3398aefd55a953c6b208bc6892543e3b9ef (diff)
downloademacs-bb1ef421878a45b3df2cd2ccf96c9b46a881d642.tar.gz
emacs-bb1ef421878a45b3df2cd2ccf96c9b46a881d642.zip
(follow_key): Check char in range before UPPERCASEP.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 98c9250fb6d..bc990170e8b 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -2095,17 +2095,21 @@ make_lispy_event (event)
2095 if (event->modifiers & ctrl_modifier) 2095 if (event->modifiers & ctrl_modifier)
2096 { 2096 {
2097 if (c >= 0100 && c < 0140) 2097 if (c >= 0100 && c < 0140)
2098 c &= ~040; 2098 {
2099 int oc = c;
2100 c &= ~0140;
2101 /* Set the shift modifier for a control char
2102 made from a shifted letter. But only for letters! */
2103 if (oc >= 'A' && oc <= 'Z')
2104 c |= shift_modifier;
2105 }
2106 else if (c >= 'a' && c <= 'z')
2107 c &= ~0140;
2099 /* Include the bits for control and shift 2108 /* Include the bits for control and shift
2100 only if the basic ASCII code can't indicate them. */ 2109 only if the basic ASCII code can't indicate them. */
2101 c |= ctrl_modifier; 2110 else
2111 c |= ctrl_modifier;
2102 } 2112 }
2103 /* Set the shift modifier for a control char
2104 made from a shifted letter. But only for letters! */
2105 if (XFASTINT (event->code) >= 'A' - 0100
2106 && XFASTINT (event->code) <= 'Z' - 0100
2107 && (event->modifiers & shift_modifier))
2108 c |= shift_modifier;
2109 c |= (event->modifiers 2113 c |= (event->modifiers
2110 & (meta_modifier | alt_modifier 2114 & (meta_modifier | alt_modifier
2111 | hyper_modifier | super_modifier)); 2115 | hyper_modifier | super_modifier));
@@ -3389,7 +3393,9 @@ follow_key (key, nmaps, current, defs, next)
3389 lower-case letter, return the bindings for the lower-case letter. */ 3393 lower-case letter, return the bindings for the lower-case letter. */
3390 if (first_binding == nmaps 3394 if (first_binding == nmaps
3391 && XTYPE (key) == Lisp_Int 3395 && XTYPE (key) == Lisp_Int
3392 && (UPPERCASEP (XINT (key) & 0x3ffff) 3396 && ((((XINT (key) & 0x3ffff)
3397 < XSTRING (current_buffer->downcase_table)->size)
3398 && UPPERCASEP (XINT (key) & 0x3ffff))
3393 || (XINT (key) & shift_modifier))) 3399 || (XINT (key) & shift_modifier)))
3394 { 3400 {
3395 if (XINT (key) & shift_modifier) 3401 if (XINT (key) & shift_modifier)