/* Turn off constant cursor position display. */
UNSET(CONSTUPDATE);
+#ifdef NANO_WIDE
+ wctomb(NULL, 0);
+#endif
+
for (i = 0; i < kbinput_len; i++) {
#ifdef NANO_WIDE
/* Change the wide character to its multibyte value. If it's
#endif
}
+#ifdef NANO_WIDE
+ wctomb(NULL, 0);
+#endif
+
/* Turn constant cursor position display back on if it was on
* before. */
if (old_constupdate)
/* Reset all the input routines that rely on character sequences. */
void reset_kbinput(void)
{
-#ifdef NANO_WIDE
- /* Reset the multibyte and wide character interpreter states. */
- if (!ISSET(NO_UTF8)) {
- mbtowc(NULL, NULL, 0);
- wctomb(NULL, 0);
- }
-#endif
parse_kbinput(NULL, NULL, NULL, TRUE);
get_word_kbinput(0, TRUE);
}
buffer *clean_key_buffer = NULL;
size_t clean_key_buffer_len = 0;
+ mbtowc(NULL, NULL, 0);
+
/* Change all complete and valid multibyte keystrokes to
* their wide character values, discarding the others. */
for (i = 0; i < key_buffer_len; i++) {
}
}
+ mbtowc(NULL, NULL, 0);
+
/* Replace the default keystroke buffer with the non-(-1)
* keystroke buffer. */
key_buffer_len = clean_key_buffer_len;
if (!ISSET(NO_UTF8)) {
size_t i;
+ wctomb(NULL, 0);
+
/* Keep all valid wide keystrokes, discarding the others. */
for (i = 0; i < input_len; i++) {
char key[MB_LEN_MAX];
input[i].key_code;
}
}
+
+ wctomb(NULL, 0);
+
} else {
#endif
clean_input = input;