=== modified file 'termkey.c' --- termkey.c 2008-11-03 21:10:14 +0000 +++ termkey.c 2008-11-03 21:08:34 +0000 @@ -440,19 +440,8 @@ return TERMKEY_RES_KEY; } - if(tk->buffcount < nbytes) { - if(!force) - return TERMKEY_RES_AGAIN; - - /* There weren't enough bytes for a complete UTF-8 sequence but caller - * demands an answer. About the best thing we can do here is eat as many - * bytes as we have, and emit a UTF8_INVALID. If the remaining bytes - * arrive later, they'll be invalid too. - */ - (*tk->method.emit_codepoint)(tk, UTF8_INVALID, key); - (*tk->method.eat_bytes)(tk, tk->buffcount); - return TERMKEY_RES_KEY; - } + if(tk->buffcount < nbytes) + return tk->waittime ? TERMKEY_RES_AGAIN : TERMKEY_RES_NONE; for(int b = 1; b < nbytes; b++) { unsigned char cb = CHARAT(b);