From 0cfc382355b71a9dd57b872e30f50463cabd5e2e Mon Sep 17 00:00:00 2001 From: "Diogo Franco (Kovensky)" Date: Thu, 25 Jul 2013 13:29:10 -0300 Subject: [PATCH] getch2: Doing it right this time getch2_pos should be set to 1, not 0, when backtracking. Avoids the possible infinite loop but correctly. --- osdep/getch2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osdep/getch2.c b/osdep/getch2.c index c19a410252..4ac955788c 100644 --- a/osdep/getch2.c +++ b/osdep/getch2.c @@ -378,7 +378,7 @@ bool getch2(struct input_ctx *input_ctx) continue; /* need more bytes to disambiguate */ } else { /* backtrack, send as UTF-8 */ - getch2_pos = 0; + getch2_pos = 1; c = getch2_buf[0]; } utf8_len = bstr_parse_utf8_code_length(c);