sync with OpenBSD -current

This commit is contained in:
purplerain 2024-07-13 21:15:57 +02:00
parent ae019f102d
commit bc7421a947
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
142 changed files with 4267 additions and 1365 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: tty-keys.c,v 1.174 2024/06/24 08:30:50 nicm Exp $ */
/* $OpenBSD: tty-keys.c,v 1.175 2024/07/12 11:21:18 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@ -911,6 +911,8 @@ tty_keys_extended_key(struct tty *tty, const char *buf, size_t len,
cc_t bspace;
key_code nkey;
key_code onlykey;
struct utf8_data ud;
utf8_char uc;
*size = 0;
@ -960,6 +962,15 @@ tty_keys_extended_key(struct tty *tty, const char *buf, size_t len,
else
nkey = number;
/* Convert UTF-32 codepoint into internal representation. */
if (nkey & ~0x7f) {
if (utf8_fromwc(nkey, &ud) == UTF8_DONE &&
utf8_from_data(&ud, &uc) == UTF8_DONE)
nkey = uc;
else
return (-1);
}
/* Update the modifiers. */
if (modifiers > 0) {
modifiers--;