aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornicm <nicm>2015-10-20 14:19:27 +0000
committernicm <nicm>2015-10-20 14:19:27 +0000
commit8c8cddbe022af5ece9949804cacffbee6b8972fa (patch)
tree83b1dca555fd9efe1d0a11722de48d65b21c6394
parent174a2ad731055f97838290226d656813143620ca (diff)
downloadrtmux-8c8cddbe022af5ece9949804cacffbee6b8972fa.tar.gz
rtmux-8c8cddbe022af5ece9949804cacffbee6b8972fa.tar.bz2
rtmux-8c8cddbe022af5ece9949804cacffbee6b8972fa.zip
The table could change when retrying so don't save it at start of
server_client_handle_key.
-rw-r--r--server-client.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/server-client.c b/server-client.c
index 52ced4d4..320389af 100644
--- a/server-client.c
+++ b/server-client.c
@@ -541,7 +541,7 @@ server_client_handle_key(struct client *c, int key)
struct window *w;
struct window_pane *wp;
struct timeval tv;
- struct key_table *table = c->keytable;
+ struct key_table *table;
struct key_binding bd_find, *bd;
int xtimeout;
@@ -607,7 +607,7 @@ server_client_handle_key(struct client *c, int key)
retry:
/* Try to see if there is a key binding in the current table. */
bd_find.key = key;
- bd = RB_FIND(key_bindings, &table->key_bindings, &bd_find);
+ bd = RB_FIND(key_bindings, &c->keytable->key_bindings, &bd_find);
if (bd != NULL) {
/*
* Key was matched in this table. If currently repeating but a
@@ -625,6 +625,7 @@ retry:
* Take a reference to this table to make sure the key binding
* doesn't disappear.
*/
+ table = c->keytable;
table->references++;
/*