diff options
author | nicm <nicm> | 2016-03-01 12:06:07 +0000 |
---|---|---|
committer | nicm <nicm> | 2016-03-01 12:06:07 +0000 |
commit | f0239a8fe97367ce7ab66d18716c411b424a0e63 (patch) | |
tree | 13bc7da30a4bfe0833a3a3a655a90e6fc4b97b4b | |
parent | 2e4503ad4eec5422e6425480681a261258f7e940 (diff) | |
download | rtmux-f0239a8fe97367ce7ab66d18716c411b424a0e63.tar.gz rtmux-f0239a8fe97367ce7ab66d18716c411b424a0e63.tar.bz2 rtmux-f0239a8fe97367ce7ab66d18716c411b424a0e63.zip |
Remove some more unused variables, and use RB_FOREACH_SAFE in
key_bindings_unref_table.
-rw-r--r-- | cmd-if-shell.c | 3 | ||||
-rw-r--r-- | cmd-resize-pane.c | 1 | ||||
-rw-r--r-- | cmd.c | 1 | ||||
-rw-r--r-- | key-bindings.c | 4 |
4 files changed, 3 insertions, 6 deletions
diff --git a/cmd-if-shell.c b/cmd-if-shell.c index 229289cd..3e2a5251 100644 --- a/cmd-if-shell.c +++ b/cmd-if-shell.c @@ -73,14 +73,13 @@ cmd_if_shell_exec(struct cmd *self, struct cmd_q *cmdq) struct format_tree *ft; const char *cwd; - cwd = wp->cwd; - if (cmdq->client != NULL && cmdq->client->session == NULL) cwd = cmdq->client->cwd; else if (s != NULL) cwd = s->cwd; else cwd = NULL; + ft = format_create(cmdq, 0); format_defaults(ft, NULL, s, wl, wp); shellcmd = format_expand(ft, args->argv[0]); diff --git a/cmd-resize-pane.c b/cmd-resize-pane.c index 2b4f1c17..7ec65f10 100644 --- a/cmd-resize-pane.c +++ b/cmd-resize-pane.c @@ -68,7 +68,6 @@ cmd_resize_pane_exec(struct cmd *self, struct cmd_q *cmdq) return (CMD_RETURN_NORMAL); } - w = wl->window; if (args_has(args, 'Z')) { if (w->flags & WINDOW_ZOOMED) window_unzoom(w); @@ -482,7 +482,6 @@ cmd_prepare_state_flag(char c, const char *target, enum cmd_entry_flag flag, CMD_FIND_SESSION, CMD_FIND_QUIET); if (error == 0) break; - flag = CMD_WINDOW_INDEX; /* FALLTHROUGH */ case CMD_WINDOW: case CMD_WINDOW_CANFAIL: diff --git a/key-bindings.c b/key-bindings.c index a922eb18..0d13385d 100644 --- a/key-bindings.c +++ b/key-bindings.c @@ -68,12 +68,12 @@ void key_bindings_unref_table(struct key_table *table) { struct key_binding *bd; + struct key_binding *bd1; if (--table->references != 0) return; - while (!RB_EMPTY(&table->key_bindings)) { - bd = RB_ROOT(&table->key_bindings); + RB_FOREACH_SAFE(bd, key_bindings, &table->key_bindings, bd1) { RB_REMOVE(key_bindings, &table->key_bindings, bd); cmd_list_free(bd->cmdlist); free(bd); |