# HG changeset patch # User Markus Mützel # Date 1669572511 -3600 # Node ID 54f336bbb833e23f79faf7652d757655d05105f1 # Parent a76f513700df21e817ce3b4ffe177e3a4b696d48 readline: Improve check for UTF-16 surrogates (bug #63400). * src/readline-2-event-hook.patch: Avoid false positives for UTF-16 surrogate halves. diff -r a76f513700df -r 54f336bbb833 src/readline-2-event-hook.patch --- a/src/readline-2-event-hook.patch Sun Nov 27 19:08:31 2022 +0100 +++ b/src/readline-2-event-hook.patch Sun Nov 27 19:08:31 2022 +0100 @@ -138,7 +138,7 @@ + char charbuf[5] = {0}; + wchar_t unicode[2] = {result, 0}; + int utf16_code_units = 1; -+ if (unicode[0] & 0xD800) /* outside BMP */ ++ if ((unicode[0] & 0xF800) == 0xD800) /* outside BMP */ + { + unicode[1] = _win32_getch_internal (0, &is_char); + utf16_code_units++;