diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-08-23 16:45:00 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-08-23 16:45:00 +0000 |
commit | 43cd40e87a41d9504dcac99419c96e3cdbb81029 (patch) | |
tree | f6ec67c9e1fd7cd800ce8ef67b96633afd7cacff | |
parent | 1eb303e6d401c1ef2992933532eb2d7eab36cecf (diff) | |
download | rtmux-43cd40e87a41d9504dcac99419c96e3cdbb81029.tar.gz rtmux-43cd40e87a41d9504dcac99419c96e3cdbb81029.tar.bz2 rtmux-43cd40e87a41d9504dcac99419c96e3cdbb81029.zip |
The cursession member in struct cmd_ctx is always either curclient->session or
NULL when curclient is also NULL, so just eliminate it.
-rw-r--r-- | cfg.c | 1 | ||||
-rw-r--r-- | cmd-command-prompt.c | 1 | ||||
-rw-r--r-- | cmd-confirm-before.c | 1 | ||||
-rw-r--r-- | cmd.c | 4 | ||||
-rw-r--r-- | key-bindings.c | 3 | ||||
-rw-r--r-- | server-msg.c | 1 | ||||
-rw-r--r-- | tmux.h | 2 |
7 files changed, 3 insertions, 10 deletions
@@ -88,7 +88,6 @@ load_cfg(const char *path, char **cause) cfg_cause = NULL; ctx.msgdata = NULL; - ctx.cursession = NULL; ctx.curclient = NULL; ctx.error = cfg_error; diff --git a/cmd-command-prompt.c b/cmd-command-prompt.c index e4954ddd..cd417a61 100644 --- a/cmd-command-prompt.c +++ b/cmd-command-prompt.c @@ -238,7 +238,6 @@ cmd_command_prompt_callback(void *data, const char *s) } ctx.msgdata = NULL; - ctx.cursession = c->session; ctx.curclient = c; ctx.error = key_bindings_error; diff --git a/cmd-confirm-before.c b/cmd-confirm-before.c index fd366b9b..d0a2196a 100644 --- a/cmd-confirm-before.c +++ b/cmd-confirm-before.c @@ -122,7 +122,6 @@ cmd_confirm_before_callback(void *data, const char *s) } ctx.msgdata = NULL; - ctx.cursession = c->session; ctx.curclient = c; ctx.error = key_bindings_error; @@ -299,8 +299,8 @@ cmd_current_session(struct cmd_ctx *ctx) u_int i; int found; - if (ctx->cursession != NULL) - return (ctx->cursession); + if (ctx->curclient != NULL && ctx->curclient->session != NULL) + return (ctx->curclient->session); /* * If the name of the calling client's pty is know, build a list of the diff --git a/key-bindings.c b/key-bindings.c index 186c1a9b..b2ccc4aa 100644 --- a/key-bindings.c +++ b/key-bindings.c @@ -218,7 +218,7 @@ key_bindings_error(struct cmd_ctx *ctx, const char *fmt, ...) void printflike2 key_bindings_print(struct cmd_ctx *ctx, const char *fmt, ...) { - struct winlink *wl = ctx->cursession->curw; + struct winlink *wl = ctx->curclient->session->curw; va_list ap; if (wl->window->active->mode != &window_more_mode) @@ -254,7 +254,6 @@ key_bindings_dispatch(struct key_binding *bd, struct client *c) struct cmd_ctx ctx; ctx.msgdata = NULL; - ctx.cursession = c->session; ctx.curclient = c; ctx.error = key_bindings_error; diff --git a/server-msg.c b/server-msg.c index e8aea526..54bd2439 100644 --- a/server-msg.c +++ b/server-msg.c @@ -188,7 +188,6 @@ server_msg_command(struct client *c, struct msg_command_data *data) ctx.msgdata = data; ctx.curclient = NULL; - ctx.cursession = NULL; ctx.cmdclient = c; @@ -988,8 +988,6 @@ struct cmd_ctx { struct client *curclient; struct client *cmdclient; - struct session *cursession; - struct msg_command_data *msgdata; void printflike2 (*print)(struct cmd_ctx *, const char *, ...); |