Mercurial > mxe-octave
comparison src/readline-2-event-hook.patch @ 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 | a6f1111a9f1d |
comparison
equal
deleted
inserted
replaced
6545:a76f513700df | 6546:54f336bbb833 |
---|---|
136 + if (is_char) | 136 + if (is_char) |
137 + { | 137 + { |
138 + char charbuf[5] = {0}; | 138 + char charbuf[5] = {0}; |
139 + wchar_t unicode[2] = {result, 0}; | 139 + wchar_t unicode[2] = {result, 0}; |
140 + int utf16_code_units = 1; | 140 + int utf16_code_units = 1; |
141 + if (unicode[0] & 0xD800) /* outside BMP */ | 141 + if ((unicode[0] & 0xF800) == 0xD800) /* outside BMP */ |
142 + { | 142 + { |
143 + unicode[1] = _win32_getch_internal (0, &is_char); | 143 + unicode[1] = _win32_getch_internal (0, &is_char); |
144 + utf16_code_units++; | 144 + utf16_code_units++; |
145 + } | 145 + } |
146 + /* convert to UTF-8 byte sequence */ | 146 + /* convert to UTF-8 byte sequence */ |