Make termkey_getkey() set a peeked key structure if it returns TERMKEY_RET_AGAIN

This commit is contained in:
Paul LeoNerd Evans
2008-12-10 00:38:21 +00:00
parent ef669c134d
commit 696c145599
2 changed files with 20 additions and 14 deletions

View File

@@ -679,6 +679,11 @@ termkey_result termkey_getkey(termkey_t *tk, termkey_key *key)
if(ret == TERMKEY_RES_KEY)
eat_bytes(tk, nbytes);
if(ret == TERMKEY_RES_AGAIN)
/* Call peekkey() again in force mode to obtain whatever it can */
(void)peekkey(tk, key, 1, &nbytes);
/* Don't eat it yet though */
return ret;
}