1
0
mirror of https://github.com/tmux/tmux.git synced 2025-04-16 16:38:49 +00:00

Extend 0x1234 keys form to more bits so that Unicode keys work.

This commit is contained in:
nicm 2016-05-26 14:49:48 +00:00
parent cd14ac0486
commit ec7f5305b1

View File

@ -146,8 +146,7 @@ key_string_lookup_string(const char *string)
{ {
static const char *other = "!#()+,-.0123456789:;<=>?'\r\t"; static const char *other = "!#()+,-.0123456789:;<=>?'\r\t";
key_code key; key_code key;
u_short u; u_int u;
int size;
key_code modifiers; key_code modifiers;
struct utf8_data ud; struct utf8_data ud;
u_int i; u_int i;
@ -160,7 +159,9 @@ key_string_lookup_string(const char *string)
/* Is this a hexadecimal value? */ /* Is this a hexadecimal value? */
if (string[0] == '0' && string[1] == 'x') { if (string[0] == '0' && string[1] == 'x') {
if (sscanf(string + 2, "%hx%n", &u, &size) != 1 || size > 4) if (sscanf(string + 2, "%x", &u) != 1)
return (KEYC_UNKNOWN);
if (u > 0x1fffff)
return (KEYC_UNKNOWN); return (KEYC_UNKNOWN);
return (u); return (u);
} }