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

Diff for /src/usr.bin/tmux/cmd-if-shell.c between version 1.9 and 1.10

version 1.9, 2010/07/24 20:11:59 version 1.10, 2011/01/04 00:42:46
Line 35 
Line 35 
   
 const struct cmd_entry cmd_if_shell_entry = {  const struct cmd_entry cmd_if_shell_entry = {
         "if-shell", "if",          "if-shell", "if",
           "", 2, 2,
         "shell-command command",          "shell-command command",
         CMD_ARG2, "",          0,
         cmd_target_init,          NULL,
         cmd_target_parse,          NULL,
         cmd_if_shell_exec,          cmd_if_shell_exec
         cmd_target_free,  
         cmd_target_print  
 };  };
   
 struct cmd_if_shell_data {  struct cmd_if_shell_data {
Line 52 
Line 51 
 int  int
 cmd_if_shell_exec(struct cmd *self, struct cmd_ctx *ctx)  cmd_if_shell_exec(struct cmd *self, struct cmd_ctx *ctx)
 {  {
         struct cmd_target_data          *data = self->data;          struct args                     *args = self->args;
         struct cmd_if_shell_data        *cdata;          struct cmd_if_shell_data        *cdata;
         struct job                      *job;          struct job                      *job;
   
         cdata = xmalloc(sizeof *cdata);          cdata = xmalloc(sizeof *cdata);
         cdata->cmd = xstrdup(data->arg2);          cdata->cmd = xstrdup(args->argv[1]);
         memcpy(&cdata->ctx, ctx, sizeof cdata->ctx);          memcpy(&cdata->ctx, ctx, sizeof cdata->ctx);
   
         if (ctx->cmdclient != NULL)          if (ctx->cmdclient != NULL)
Line 66 
Line 65 
                 ctx->curclient->references++;                  ctx->curclient->references++;
   
         job = job_add(NULL, 0, NULL,          job = job_add(NULL, 0, NULL,
             data->arg, cmd_if_shell_callback, cmd_if_shell_free, cdata);              args->argv[0], cmd_if_shell_callback, cmd_if_shell_free, cdata);
         job_run(job);          job_run(job);
   
         return (1);     /* don't let client exit */          return (1);     /* don't let client exit */

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10