The branch, master has been updated
       via  c5ad47ee7c7595c1d0dcf2a226742fd19d548605 (commit)
      from  4d38b6d1fab398b0af6d22281d0d4b35448524f7 (commit)

- Log -----------------------------------------------------------------
commit c5ad47ee7c7595c1d0dcf2a226742fd19d548605
Author: Nicholas Marriott <nicholas.marri...@gmail.com>
Commit: Nicholas Marriott <nicholas.marri...@gmail.com>

    Only send end guard if begin was sent, from George Nachman.
---
 cmd-queue.c |   21 ++++++++++++---------
 tmux.h      |    2 +-
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/cmd-queue.c b/cmd-queue.c
index 17992a3..6ea6f46 100644
--- a/cmd-queue.c
+++ b/cmd-queue.c
@@ -152,19 +152,20 @@ cmdq_error(struct cmd_q *cmdq, const char *fmt, ...)
 }
 
 /* Print a guard line. */
-void
+int
 cmdq_guard(struct cmd_q *cmdq, const char *guard)
 {
        struct client   *c = cmdq->client;
 
        if (c == NULL || c->session == NULL)
-               return;
+               return 0;
        if (!(c->flags & CLIENT_CONTROL))
-               return;
+               return 0;
 
        evbuffer_add_printf(c->stdout_data, "%%%s %ld %u\n", guard,
            (long) cmdq->time, cmdq->number);
        server_push_stdout(c);
+       return 1;
 }
 
 /* Add command list to queue and begin processing if needed. */
@@ -197,7 +198,7 @@ cmdq_continue(struct cmd_q *cmdq)
 {
        struct cmd_q_item       *next;
        enum cmd_retval          retval;
-       int                      empty;
+       int                      empty, guard;
        char                     s[1024];
 
        notify_disable();
@@ -223,12 +224,14 @@ cmdq_continue(struct cmd_q *cmdq)
                        cmdq->time = time(NULL);
                        cmdq->number++;
 
-                       cmdq_guard(cmdq, "begin");
+                       guard = cmdq_guard(cmdq, "begin");
                        retval = cmdq->cmd->entry->exec(cmdq->cmd, cmdq);
-                       if (retval == CMD_RETURN_ERROR)
-                               cmdq_guard(cmdq, "error");
-                       else
-                               cmdq_guard(cmdq, "end");
+                       if (guard) {
+                               if (retval == CMD_RETURN_ERROR)
+                                   cmdq_guard(cmdq, "error");
+                               else
+                                   cmdq_guard(cmdq, "end");
+                       }
 
                        if (retval == CMD_RETURN_ERROR)
                                break;
diff --git a/tmux.h b/tmux.h
index 89860cb..7c4c55b 100644
--- a/tmux.h
+++ b/tmux.h
@@ -1856,7 +1856,7 @@ int                cmdq_free(struct cmd_q *);
 void printflike2 cmdq_print(struct cmd_q *, const char *, ...);
 void printflike2 cmdq_info(struct cmd_q *, const char *, ...);
 void printflike2 cmdq_error(struct cmd_q *, const char *, ...);
-void            cmdq_guard(struct cmd_q *, const char *);
+int             cmdq_guard(struct cmd_q *, const char *);
 void            cmdq_run(struct cmd_q *, struct cmd_list *);
 void            cmdq_append(struct cmd_q *, struct cmd_list *);
 int             cmdq_continue(struct cmd_q *);


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

Summary of changes:
 cmd-queue.c |   21 ++++++++++++---------
 tmux.h      |    2 +-
 2 files changed, 13 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
tmux

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
tmux-cvs mailing list
tmux-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-cvs

Reply via email to