Skip to content

Commit

Permalink
The table could change when retrying so don't save it at start of
Browse files Browse the repository at this point in the history
server_client_handle_key.
  • Loading branch information
nicm committed Oct 20, 2015
1 parent 174a2ad commit 8c8cddb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand All @@ -625,6 +625,7 @@ server_client_handle_key(struct client *c, int key)
* Take a reference to this table to make sure the key binding
* doesn't disappear.
*/
table = c->keytable;
table->references++;

/*
Expand Down

0 comments on commit 8c8cddb

Please sign in to comment.