diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2017-02-16 07:49:03 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2017-02-16 07:54:12 -0800 |
commit | 064541af6a71bf45d530fe34b7e00c8123ee93d8 (patch) | |
tree | d9bd173548eda3d477c0077cd21c638a41e5e0d8 /src/keyboard.c | |
parent | 501ad546263ed2a902be1c9d8c1bb3af5794066b (diff) | |
download | emacs-064541af6a71bf45d530fe34b7e00c8123ee93d8.tar.gz emacs-064541af6a71bf45d530fe34b7e00c8123ee93d8.tar.bz2 emacs-064541af6a71bf45d530fe34b7e00c8123ee93d8.zip |
* src/keyboard.c (read_key_sequence): Fix integer-overflow glitch.
Diffstat (limited to 'src/keyboard.c')
-rw-r--r-- | src/keyboard.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 0fad633581d..d2f4b504abf 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -5421,26 +5421,26 @@ make_lispy_event (struct input_event *event) not. And Control+Shift+s should produce C-S-s whether caps-lock is on or not. */ if (event->modifiers & ~shift_modifier) - { + { /* This is a key chord: some non-shift modifier is depressed. */ if (uppercasep (c) && !(event->modifiers & shift_modifier)) - { + { /* Got a capital letter without a shift. The caps lock is on. Un-capitalize the letter. */ c = downcase (c); - } + } else if (lowercasep (c) && (event->modifiers & shift_modifier)) - { + { /* Got a lower-case letter even though shift is depressed. The caps lock is on. Capitalize the letter. */ c = upcase (c); - } - } + } + } if (event->kind == ASCII_KEYSTROKE_EVENT) { @@ -9645,13 +9645,13 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, && INTEGERP (key)) { Lisp_Object new_key; - int k = XINT (key); + EMACS_INT k = XINT (key); if (k & shift_modifier) XSETINT (new_key, k & ~shift_modifier); else if (CHARACTERP (make_number (k & ~CHAR_MODIFIER_MASK))) { - int dc = downcase(k & ~CHAR_MODIFIER_MASK); + int dc = downcase (k & ~CHAR_MODIFIER_MASK); if (dc == (k & ~CHAR_MODIFIER_MASK)) goto not_upcase; XSETINT (new_key, dc | (k & CHAR_MODIFIER_MASK)); |