Have getkey/waitkey return RES_ERROR/EINVAL if stopped

This commit is contained in:
Paul LeoNerd Evans
2012-03-08 21:31:16 +00:00
parent cb00476f09
commit 8237f3a1bc
2 changed files with 12 additions and 1 deletions

View File

@@ -733,6 +733,11 @@ static TermKeyResult peekkey(TermKey *tk, TermKeyKey *key, int force, size_t *nb
{
int again = 0;
if(!tk->is_started) {
errno = EINVAL;
return TERMKEY_RES_ERROR;
}
#ifdef DEBUG
fprintf(stderr, "getkey(force=%d): buffer ", force);
print_buffer(tk);