diff options
author | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2008-11-09 19:29:30 +0000 |
---|---|---|
committer | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2008-11-09 19:29:30 +0000 |
commit | de74ffa67f91b4b3415eabd54ae9a2c931a88a1b (patch) | |
tree | cd8faded3a440751999be1d6ec50fb01769f7328 | |
parent | 0483eacb68839de06bb6046d8ddeddaefb4df022 (diff) | |
download | termo-de74ffa67f91b4b3415eabd54ae9a2c931a88a1b.tar.gz termo-de74ffa67f91b4b3415eabd54ae9a2c931a88a1b.tar.xz termo-de74ffa67f91b4b3415eabd54ae9a2c931a88a1b.zip |
getkey_simple() should return TERMKEY_RES_NONE if no bytes available; as a safety check
-rw-r--r-- | termkey.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -359,6 +359,9 @@ static void emit_codepoint(termkey_t *tk, long codepoint, termkey_key *key) static termkey_result getkey_simple(termkey_t *tk, termkey_key *key, int force) { + if(tk->buffcount == 0) + return tk->is_closed ? TERMKEY_RES_EOF : TERMKEY_RES_NONE; + unsigned char b0 = CHARAT(0); if(b0 == 0x1b) { |