[BACK]Return to cmd-capture-pane.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/cmd-capture-pane.c between version 1.18 and 1.19

version 1.18, 2013/03/22 15:56:11 version 1.19, 2013/03/24 09:54:10
Line 27 
Line 27 
  * Write the entire contents of a pane to a buffer or stdout.   * Write the entire contents of a pane to a buffer or stdout.
  */   */
   
 enum cmd_retval  cmd_capture_pane_exec(struct cmd *, struct cmd_ctx *);  enum cmd_retval  cmd_capture_pane_exec(struct cmd *, struct cmd_q *);
   
 const struct cmd_entry cmd_capture_pane_entry = {  const struct cmd_entry cmd_capture_pane_entry = {
         "capture-pane", "capturep",          "capture-pane", "capturep",
Line 41 
Line 41 
 };  };
   
 enum cmd_retval  enum cmd_retval
 cmd_capture_pane_exec(struct cmd *self, struct cmd_ctx *ctx)  cmd_capture_pane_exec(struct cmd *self, struct cmd_q *cmdq)
 {  {
         struct args             *args = self->args;          struct args             *args = self->args;
         struct client           *c;          struct client           *c;
Line 55 
Line 55 
         struct grid_cell        *gc;          struct grid_cell        *gc;
         const struct grid_line  *gl;          const struct grid_line  *gl;
   
         if (cmd_find_pane(ctx, args_get(args, 't'), NULL, &wp) == NULL)          if (cmd_find_pane(cmdq, args_get(args, 't'), NULL, &wp) == NULL)
                 return (CMD_RETURN_ERROR);                  return (CMD_RETURN_ERROR);
         s = &wp->base;          s = &wp->base;
         gd = s->grid;          gd = s->grid;
Line 113 
Line 113 
         }          }
   
         if (args_has(args, 'p')) {          if (args_has(args, 'p')) {
                 c = ctx->curclient;                  c = cmdq->client;
                 if (c == NULL || !(c->flags & CLIENT_CONTROL))                  if (c == NULL ||
                         c = ctx->cmdclient;                      (c->session != NULL && !(c->flags & CLIENT_CONTROL))) {
                 if (c == NULL) {                          cmdq_error(cmdq, "can't write to stdout");
                         ctx->error(ctx, "can't write to stdout");  
                         return (CMD_RETURN_ERROR);                          return (CMD_RETURN_ERROR);
                 }                  }
                 evbuffer_add(c->stdout_data, buf, len);                  evbuffer_add(c->stdout_data, buf, len);
Line 131 
Line 130 
   
                 buffer = args_strtonum(args, 'b', 0, INT_MAX, &cause);                  buffer = args_strtonum(args, 'b', 0, INT_MAX, &cause);
                 if (cause != NULL) {                  if (cause != NULL) {
                         ctx->error(ctx, "buffer %s", cause);                          cmdq_error(cmdq, "buffer %s", cause);
                         free(buf);                          free(buf);
                         free(cause);                          free(cause);
                         return (CMD_RETURN_ERROR);                          return (CMD_RETURN_ERROR);
                 }                  }
   
                 if (paste_replace(&global_buffers, buffer, buf, len) != 0) {                  if (paste_replace(&global_buffers, buffer, buf, len) != 0) {
                         ctx->error(ctx, "no buffer %d", buffer);                          cmdq_error(cmdq, "no buffer %d", buffer);
                         free(buf);                          free(buf);
                         return (CMD_RETURN_ERROR);                          return (CMD_RETURN_ERROR);
                 }                  }

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19