summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2013-03-22 15:54:30 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2013-03-22 15:54:30 +0000
commita4c3a184c185667c1cc5e97db9b8d372b7e1f2db (patch)
tree1c7199ddecba11a92e8d0eebf0958b225eb2a5e3 /usr.bin
parent2d3dfde0328b40bfd84934673158795a86bf0e3c (diff)
Need to set clients in context before changing their reference count.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/cfg.c4
-rw-r--r--usr.bin/tmux/cmd-command-prompt.c5
-rw-r--r--usr.bin/tmux/cmd-confirm-before.c5
-rw-r--r--usr.bin/tmux/cmd.c7
-rw-r--r--usr.bin/tmux/control.c5
-rw-r--r--usr.bin/tmux/key-bindings.c5
-rw-r--r--usr.bin/tmux/server-client.c5
-rw-r--r--usr.bin/tmux/tmux.h4
-rw-r--r--usr.bin/tmux/window-choose.c5
9 files changed, 21 insertions, 24 deletions
diff --git a/usr.bin/tmux/cfg.c b/usr.bin/tmux/cfg.c
index 61fbe611725..858056e8b86 100644
--- a/usr.bin/tmux/cfg.c
+++ b/usr.bin/tmux/cfg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cfg.c,v 1.26 2013/03/22 15:50:13 nicm Exp $ */
+/* $OpenBSD: cfg.c,v 1.27 2013/03/22 15:54:29 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -92,7 +92,7 @@ load_cfg(const char *path, struct cmd_ctx *ctx, struct causelist *causes)
if (ctx != NULL)
cmd_ref_ctx(ctx);
else {
- ctx = cmd_get_ctx();
+ ctx = cmd_get_ctx(NULL, NULL);
ctx->error = cfg_error;
ctx->print = cfg_print;
ctx->info = cfg_print;
diff --git a/usr.bin/tmux/cmd-command-prompt.c b/usr.bin/tmux/cmd-command-prompt.c
index 46aabd4c548..44e100997e0 100644
--- a/usr.bin/tmux/cmd-command-prompt.c
+++ b/usr.bin/tmux/cmd-command-prompt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-command-prompt.c,v 1.23 2013/03/22 15:50:42 nicm Exp $ */
+/* $OpenBSD: cmd-command-prompt.c,v 1.24 2013/03/22 15:54:29 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -184,8 +184,7 @@ cmd_command_prompt_callback(void *data, const char *s)
return (0);
}
- ctx = cmd_get_ctx();
- ctx->curclient = c;
+ ctx = cmd_get_ctx(NULL, c);
ctx->error = key_bindings_error;
ctx->print = key_bindings_print;
ctx->info = key_bindings_info;
diff --git a/usr.bin/tmux/cmd-confirm-before.c b/usr.bin/tmux/cmd-confirm-before.c
index 6d8ae58164e..d4fa92569cb 100644
--- a/usr.bin/tmux/cmd-confirm-before.c
+++ b/usr.bin/tmux/cmd-confirm-before.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-confirm-before.c,v 1.16 2013/03/22 15:50:42 nicm Exp $ */
+/* $OpenBSD: cmd-confirm-before.c,v 1.17 2013/03/22 15:54:29 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -125,8 +125,7 @@ cmd_confirm_before_callback(void *data, const char *s)
return (0);
}
- ctx = cmd_get_ctx();
- ctx->curclient = c;
+ ctx = cmd_get_ctx(NULL, c);
ctx->error = key_bindings_error;
ctx->print = key_bindings_print;
ctx->info = key_bindings_info;
diff --git a/usr.bin/tmux/cmd.c b/usr.bin/tmux/cmd.c
index e41f71c2e30..fa921129db7 100644
--- a/usr.bin/tmux/cmd.c
+++ b/usr.bin/tmux/cmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd.c,v 1.77 2013/03/22 15:49:55 nicm Exp $ */
+/* $OpenBSD: cmd.c,v 1.78 2013/03/22 15:54:29 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -134,13 +134,16 @@ int cmd_find_index_offset(const char *, struct session *, int *);
struct window_pane *cmd_find_pane_offset(const char *, struct winlink *);
struct cmd_ctx *
-cmd_get_ctx(void)
+cmd_get_ctx(struct client *cmdclient, struct client *curclient)
{
struct cmd_ctx *ctx;
ctx = xcalloc(1, sizeof *ctx);
ctx->references = 0;
+ ctx->cmdclient = cmdclient;
+ ctx->curclient = curclient;
+
cmd_ref_ctx(ctx);
return (ctx);
}
diff --git a/usr.bin/tmux/control.c b/usr.bin/tmux/control.c
index 3dfe0751623..5882c3c912f 100644
--- a/usr.bin/tmux/control.c
+++ b/usr.bin/tmux/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.6 2013/03/22 15:50:42 nicm Exp $ */
+/* $OpenBSD: control.c,v 1.7 2013/03/22 15:54:29 nicm Exp $ */
/*
* Copyright (c) 2012 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -108,8 +108,7 @@ control_callback(struct client *c, int closed, unused void *data)
break;
}
- ctx = cmd_get_ctx();
- ctx->curclient = c;
+ ctx = cmd_get_ctx(NULL, c);
ctx->error = control_msg_error;
ctx->print = control_msg_print;
ctx->info = control_msg_info;
diff --git a/usr.bin/tmux/key-bindings.c b/usr.bin/tmux/key-bindings.c
index ad0581015ec..c759adfb441 100644
--- a/usr.bin/tmux/key-bindings.c
+++ b/usr.bin/tmux/key-bindings.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: key-bindings.c,v 1.36 2013/03/22 15:50:42 nicm Exp $ */
+/* $OpenBSD: key-bindings.c,v 1.37 2013/03/22 15:54:29 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -266,8 +266,7 @@ key_bindings_dispatch(struct key_binding *bd, struct client *c)
struct cmd *cmd;
int readonly;
- ctx = cmd_get_ctx();
- ctx->curclient = c;
+ ctx = cmd_get_ctx(NULL, c);
ctx->error = key_bindings_error;
ctx->print = key_bindings_print;
ctx->info = key_bindings_info;
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c
index 365fc425e46..0a1127a2210 100644
--- a/usr.bin/tmux/server-client.c
+++ b/usr.bin/tmux/server-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server-client.c,v 1.89 2013/03/22 15:50:42 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.90 2013/03/22 15:54:29 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -870,9 +870,8 @@ server_client_msg_command(struct client *c, struct msg_command_data *data)
int argc;
char **argv, *cause;
- ctx = cmd_get_ctx();
+ ctx = cmd_get_ctx(c, NULL);
ctx->msgdata = data;
- ctx->cmdclient = c;
ctx->error = server_client_msg_error;
ctx->print = server_client_msg_print;
ctx->info = server_client_msg_info;
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index dcbe89175d3..2e3f9207037 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.389 2013/03/22 15:52:41 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.390 2013/03/22 15:54:29 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -1718,7 +1718,7 @@ long long args_strtonum(
struct args *, u_char, long long, long long, char **);
/* cmd.c */
-struct cmd_ctx *cmd_get_ctx(void);
+struct cmd_ctx *cmd_get_ctx(struct client *, struct client *);
void cmd_free_ctx(struct cmd_ctx *);
void cmd_ref_ctx(struct cmd_ctx *);
int cmd_pack_argv(int, char **, char *, size_t);
diff --git a/usr.bin/tmux/window-choose.c b/usr.bin/tmux/window-choose.c
index eef2b5e2009..1cb8fbedd62 100644
--- a/usr.bin/tmux/window-choose.c
+++ b/usr.bin/tmux/window-choose.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window-choose.c,v 1.43 2013/03/22 15:52:42 nicm Exp $ */
+/* $OpenBSD: window-choose.c,v 1.44 2013/03/22 15:54:29 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -220,8 +220,7 @@ window_choose_data_run(struct window_choose_data *cdata)
return;
}
- ctx = cmd_get_ctx();
- ctx->curclient = cdata->start_client;
+ ctx = cmd_get_ctx(NULL, cdata->start_client);
ctx->error = key_bindings_error;
ctx->print = key_bindings_print;
ctx->info = key_bindings_info;