nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit f7a3b996fa7e7406bb661e5a54a0f52196b0ead9
parent ea874112d81bcc0e8b8f43d463f0d965a56b4aff
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Wed, 22 Jan 2020 18:55:36 +0100

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.

Diffstat:
Msrc/rcfile.c | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/rcfile.c b/src/rcfile.c @@ -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')) {