mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-27 02:23:15 +01:00
The cursession member in struct cmd_ctx is always either curclient->session or
NULL when curclient is also NULL, so just eliminate it.
This commit is contained in:
parent
1eb303e6d4
commit
43cd40e87a
1
cfg.c
1
cfg.c
@ -88,7 +88,6 @@ load_cfg(const char *path, char **cause)
|
|||||||
cfg_cause = NULL;
|
cfg_cause = NULL;
|
||||||
|
|
||||||
ctx.msgdata = NULL;
|
ctx.msgdata = NULL;
|
||||||
ctx.cursession = NULL;
|
|
||||||
ctx.curclient = NULL;
|
ctx.curclient = NULL;
|
||||||
|
|
||||||
ctx.error = cfg_error;
|
ctx.error = cfg_error;
|
||||||
|
@ -238,7 +238,6 @@ cmd_command_prompt_callback(void *data, const char *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ctx.msgdata = NULL;
|
ctx.msgdata = NULL;
|
||||||
ctx.cursession = c->session;
|
|
||||||
ctx.curclient = c;
|
ctx.curclient = c;
|
||||||
|
|
||||||
ctx.error = key_bindings_error;
|
ctx.error = key_bindings_error;
|
||||||
|
@ -122,7 +122,6 @@ cmd_confirm_before_callback(void *data, const char *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ctx.msgdata = NULL;
|
ctx.msgdata = NULL;
|
||||||
ctx.cursession = c->session;
|
|
||||||
ctx.curclient = c;
|
ctx.curclient = c;
|
||||||
|
|
||||||
ctx.error = key_bindings_error;
|
ctx.error = key_bindings_error;
|
||||||
|
4
cmd.c
4
cmd.c
@ -299,8 +299,8 @@ cmd_current_session(struct cmd_ctx *ctx)
|
|||||||
u_int i;
|
u_int i;
|
||||||
int found;
|
int found;
|
||||||
|
|
||||||
if (ctx->cursession != NULL)
|
if (ctx->curclient != NULL && ctx->curclient->session != NULL)
|
||||||
return (ctx->cursession);
|
return (ctx->curclient->session);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the name of the calling client's pty is know, build a list of the
|
* If the name of the calling client's pty is know, build a list of the
|
||||||
|
@ -218,7 +218,7 @@ key_bindings_error(struct cmd_ctx *ctx, const char *fmt, ...)
|
|||||||
void printflike2
|
void printflike2
|
||||||
key_bindings_print(struct cmd_ctx *ctx, const char *fmt, ...)
|
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;
|
va_list ap;
|
||||||
|
|
||||||
if (wl->window->active->mode != &window_more_mode)
|
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;
|
struct cmd_ctx ctx;
|
||||||
|
|
||||||
ctx.msgdata = NULL;
|
ctx.msgdata = NULL;
|
||||||
ctx.cursession = c->session;
|
|
||||||
ctx.curclient = c;
|
ctx.curclient = c;
|
||||||
|
|
||||||
ctx.error = key_bindings_error;
|
ctx.error = key_bindings_error;
|
||||||
|
@ -188,7 +188,6 @@ server_msg_command(struct client *c, struct msg_command_data *data)
|
|||||||
|
|
||||||
ctx.msgdata = data;
|
ctx.msgdata = data;
|
||||||
ctx.curclient = NULL;
|
ctx.curclient = NULL;
|
||||||
ctx.cursession = NULL;
|
|
||||||
|
|
||||||
ctx.cmdclient = c;
|
ctx.cmdclient = c;
|
||||||
|
|
||||||
|
2
tmux.h
2
tmux.h
@ -988,8 +988,6 @@ struct cmd_ctx {
|
|||||||
struct client *curclient;
|
struct client *curclient;
|
||||||
struct client *cmdclient;
|
struct client *cmdclient;
|
||||||
|
|
||||||
struct session *cursession;
|
|
||||||
|
|
||||||
struct msg_command_data *msgdata;
|
struct msg_command_data *msgdata;
|
||||||
|
|
||||||
void printflike2 (*print)(struct cmd_ctx *, const char *, ...);
|
void printflike2 (*print)(struct cmd_ctx *, const char *, ...);
|
||||||
|
Loading…
Reference in New Issue
Block a user