[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.26 and 1.27

version 1.26, 2014/10/20 22:29:25 version 1.27, 2014/12/02 23:39:02
Line 37 
Line 37 
   
 const struct cmd_entry cmd_if_shell_entry = {  const struct cmd_entry cmd_if_shell_entry = {
         "if-shell", "if",          "if-shell", "if",
         "bt:", 2, 3,          "bFt:", 2, 3,
         "[-b] " CMD_TARGET_PANE_USAGE " shell-command command [command]",          "[-bF] " CMD_TARGET_PANE_USAGE " shell-command command [command]",
         0,          0,
         cmd_if_shell_exec          cmd_if_shell_exec
 };  };
Line 56 
Line 56 
 {  {
         struct args                     *args = self->args;          struct args                     *args = self->args;
         struct cmd_if_shell_data        *cdata;          struct cmd_if_shell_data        *cdata;
         char                            *shellcmd;          char                            *shellcmd, *cmd, *cause;
           struct cmd_list                 *cmdlist;
         struct client                   *c;          struct client                   *c;
         struct session                  *s = NULL;          struct session                  *s = NULL;
         struct winlink                  *wl = NULL;          struct winlink                  *wl = NULL;
Line 83 
Line 84 
                 format_window_pane(ft, wp);                  format_window_pane(ft, wp);
         shellcmd = format_expand(ft, args->argv[0]);          shellcmd = format_expand(ft, args->argv[0]);
         format_free(ft);          format_free(ft);
   
           if (args_has(args, 'F')) {
                   cmd = NULL;
                   if (*shellcmd != '0' && *shellcmd != '\0')
                           cmd = args->argv[1];
                   else if (args->argc == 3)
                           cmd = args->argv[2];
                   if (cmd == NULL)
                           return (CMD_RETURN_NORMAL);
                   if (cmd_string_parse(cmd, &cmdlist, NULL, 0, &cause) != 0) {
                           if (cause != NULL) {
                                   cmdq_error(cmdq, "%s", cause);
                                   free(cause);
                           }
                           return (CMD_RETURN_ERROR);
                   }
                   cmdq_run(cmdq, cmdlist);
                   cmd_list_free(cmdlist);
                   return (CMD_RETURN_NORMAL);
           }
   
         cdata = xmalloc(sizeof *cdata);          cdata = xmalloc(sizeof *cdata);
         cdata->cmd_if = xstrdup(args->argv[1]);          cdata->cmd_if = xstrdup(args->argv[1]);

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27