The branch, hooks has been updated
       via  7a1a3a33ef79ee8e07db1e8ee18ad429535992ca (commit)
      from  3f7cae70a767e4439712abe0bc82e4d326f73052 (commit)

- Log -----------------------------------------------------------------
commit 7a1a3a33ef79ee8e07db1e8ee18ad429535992ca
Author: Nicholas Marriott <[email protected]>
Commit: Nicholas Marriott <[email protected]>

    If CMD_PREP_CLIENT_* is not used, then state.c may be NULL.
---
 cmd-break-pane.c    |    4 ++--
 cmd-choose-client.c |    5 +++++
 cmd-find-window.c   |   10 ++++++----
 cmd-pipe-pane.c     |    4 ++--
 cmd-split-window.c  |    9 ++++-----
 5 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/cmd-break-pane.c b/cmd-break-pane.c
index aa48a75..1de3dbe 100644
--- a/cmd-break-pane.c
+++ b/cmd-break-pane.c
@@ -49,7 +49,6 @@ cmd_break_pane_exec(struct cmd *self, struct cmd_q *cmdq)
        char                    *name;
        char                    *cause;
        int                      base_idx;
-       struct client           *c = cmdq->state.c;
        struct format_tree      *ft;
        const char              *template;
        char                    *cp;
@@ -86,7 +85,8 @@ cmd_break_pane_exec(struct cmd *self, struct cmd_q *cmdq)
                        template = BREAK_PANE_TEMPLATE;
 
                ft = format_create();
-               format_client(ft, c);
+               if (cmdq->state.c != NULL)
+                       format_client(ft, cmdq->state.c);
                format_session(ft, s);
                format_winlink(ft, s, wl);
                format_window_pane(ft, wp);
diff --git a/cmd-choose-client.c b/cmd-choose-client.c
index 47544db..c56ee4b 100644
--- a/cmd-choose-client.c
+++ b/cmd-choose-client.c
@@ -61,6 +61,11 @@ cmd_choose_client_exec(struct cmd *self, struct cmd_q *cmdq)
        char                            *action;
        u_int                            i, idx, cur;
 
+       if (c == NULL) {
+               cmdq_error(cmdq, "no client available");
+               return (CMD_RETURN_ERROR);
+       }
+
        if (window_pane_set_mode(wl->window->active, &window_choose_mode) != 0)
                return (CMD_RETURN_NORMAL);
 
diff --git a/cmd-find-window.c b/cmd-find-window.c
index 3dcc782..d0a9865 100644
--- a/cmd-find-window.c
+++ b/cmd-find-window.c
@@ -136,15 +136,17 @@ cmd_find_window_exec(struct cmd *self, struct cmd_q *cmdq)
        struct args                     *args = self->args;
        struct client                   *c = cmdq->state.c;
        struct window_choose_data       *cdata;
-       struct session                  *s;
-       struct winlink                  *wl, *wm;
+       struct session                  *s = cmdq->state.tflag.s;
+       struct winlink                  *wl = cmdq->state.tflag.wl, *wm;
        struct cmd_find_window_data_list find_list;
        char                            *str, *searchstr;
        const char                      *template;
        u_int                            i, match_flags;
 
-       s = c->session;
-       wl = cmdq->state.tflag.wl;
+       if (c == NULL) {
+               cmdq_error(cmdq, "no client available");
+               return (CMD_RETURN_ERROR);
+       }
 
        if ((template = args_get(args, 'F')) == NULL)
                template = FIND_WINDOW_TEMPLATE;
diff --git a/cmd-pipe-pane.c b/cmd-pipe-pane.c
index 513af72..65db3da 100644
--- a/cmd-pipe-pane.c
+++ b/cmd-pipe-pane.c
@@ -104,8 +104,8 @@ cmd_pipe_pane_exec(struct cmd *self, struct cmd_q *cmdq)
 
                closefrom(STDERR_FILENO + 1);
 
-               command = status_replace(
-                   c, NULL, NULL, NULL, args->argv[0], time(NULL), 0);
+               command = status_replace(c, NULL, NULL, NULL, args->argv[0],
+                   time(NULL), 0);
                execl(_PATH_BSHELL, "sh", "-c", command, (char *) NULL);
                _exit(1);
        default:
diff --git a/cmd-split-window.c b/cmd-split-window.c
index 6839d78..19b8171 100644
--- a/cmd-split-window.c
+++ b/cmd-split-window.c
@@ -58,7 +58,6 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq)
        int                      argc, size, percentage, cwd, fd = -1;
        enum layout_type         type;
        struct layout_cell      *lc;
-       struct client           *c;
        struct format_tree      *ft;
        struct environ_entry    *envent;
 
@@ -85,8 +84,8 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq)
 
        if (args_has(args, 'c')) {
                ft = format_create();
-               if ((c = cmd_find_client(cmdq, NULL, 1)) != NULL)
-                       format_client(ft, c);
+               if (cmdq->state.c != NULL)
+                       format_client(ft, cmdq->state.c);
                format_session(ft, s);
                format_winlink(ft, s, s->curw);
                format_window_pane(ft, s->curw->window->active);
@@ -177,8 +176,8 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq)
                        template = SPLIT_WINDOW_TEMPLATE;
 
                ft = format_create();
-               if ((c = cmd_find_client(cmdq, NULL, 1)) != NULL)
-                       format_client(ft, c);
+               if (cmdq->state.c != NULL)
+                       format_client(ft, cmdq->state.c);
                format_session(ft, s);
                format_winlink(ft, s, wl);
                format_window_pane(ft, new_wp);


-----------------------------------------------------------------------

Summary of changes:
 cmd-break-pane.c    |    4 ++--
 cmd-choose-client.c |    5 +++++
 cmd-find-window.c   |   10 ++++++----
 cmd-pipe-pane.c     |    4 ++--
 cmd-split-window.c  |    9 ++++-----
 5 files changed, 19 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
tmux

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs

Reply via email to