summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/tty-keys.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2012-09-03 06:26:49 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2012-09-03 06:26:49 +0000
commitd4bb35bb5006173716dbfce6464c576c7ae4fde6 (patch)
treec26c45887e7f77a395bf0b02292d88e5ba29d3d5 /usr.bin/tmux/tty-keys.c
parent8ce6248d20d1610e1851308b4ab23ca638966290 (diff)
Can't call evtimer_pending on uninitialized events, call
evtimer_initialized first. Reported by Vladimir Lomov, fix from Thomas Adam slightly modified by me.
Diffstat (limited to 'usr.bin/tmux/tty-keys.c')
-rw-r--r--usr.bin/tmux/tty-keys.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/tmux/tty-keys.c b/usr.bin/tmux/tty-keys.c
index 8057a199987..b8014c7bd5e 100644
--- a/usr.bin/tmux/tty-keys.c
+++ b/usr.bin/tmux/tty-keys.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty-keys.c,v 1.43 2012/08/21 10:08:11 nicm Exp $ */
+/* $OpenBSD: tty-keys.c,v 1.44 2012/09/03 06:26:48 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -533,6 +533,7 @@ partial_key:
* timer has expired, give up waiting and send the escape.
*/
if ((tty->flags & TTY_ESCAPE) &&
+ evtimer_initialized(&tty->key_timer) &&
!evtimer_pending(&tty->key_timer, NULL)) {
evbuffer_drain(tty->event->input, 1);
key = '\033';
@@ -543,7 +544,8 @@ partial_key:
start_timer:
/* If already waiting for timer, do nothing. */
- if (evtimer_pending(&tty->key_timer, NULL))
+ if (evtimer_initialized(&tty->key_timer) &&
+ evtimer_pending(&tty->key_timer, NULL))
return (0);
/* Start the timer and wait for expiry or more data. */