changeset 6546:54f336bbb833

readline: Improve check for UTF-16 surrogates (bug #63400). * src/readline-2-event-hook.patch: Avoid false positives for UTF-16 surrogate halves.
author Markus Mützel <markus.muetzel@gmx.de>
date Sun, 27 Nov 2022 19:08:31 +0100
parents a76f513700df
children 696b42891580
files src/readline-2-event-hook.patch
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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++;