bindings: force the first letter in a key name to uppercase

So that converting it to a key code remains easy.

This fixes https://savannah.gnu.org/bugs/?57655.

Bug existed since commit 077d307b from yesterday.
This commit is contained in:
Benno Schulenberg 2020-01-22 18:55:36 +01:00
parent ea874112d8
commit f7a3b996fa
1 changed files with 5 additions and 2 deletions

View File

@ -719,8 +719,11 @@ void parse_binding(char *ptr, bool dobind)
ptr = parse_next_word(ptr);
keycopy = copy_of(keyptr);
/* Force the first character of the key name to uppercase. */
keycopy[0] = toupper((unsigned char)keycopy[0]);
/* Uppercase either the second or the first character of the key name. */
if (keycopy[0] == '^')
keycopy[1] = toupper((unsigned char)keycopy[1]);
else
keycopy[0] = toupper((unsigned char)keycopy[0]);
/* Verify that the key name is not too short, to allow the next call. */
if (keycopy[1] == '\0' || (keycopy[0] == 'M' && keycopy[2] == '\0')) {