[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.37 and 1.38

version 1.37, 2015/12/11 12:27:36 version 1.38, 2015/12/13 14:32:38
Line 39 
Line 39 
         "if-shell", "if",          "if-shell", "if",
         "bFt:", 2, 3,          "bFt:", 2, 3,
         "[-bF] " CMD_TARGET_PANE_USAGE " shell-command command [command]",          "[-bF] " CMD_TARGET_PANE_USAGE " shell-command command [command]",
         0,          CMD_PANE_T|CMD_CANFAIL,
         cmd_if_shell_exec          cmd_if_shell_exec
 };  };
   
Line 61 
Line 61 
         struct cmd_if_shell_data        *cdata;          struct cmd_if_shell_data        *cdata;
         char                            *shellcmd, *cmd, *cause;          char                            *shellcmd, *cmd, *cause;
         struct cmd_list                 *cmdlist;          struct cmd_list                 *cmdlist;
         struct client                   *c;          struct session                  *s = cmdq->state.tflag.s;
         struct session                  *s = NULL;          struct winlink                  *wl = cmdq->state.tflag.wl;
         struct winlink                  *wl = NULL;          struct window_pane              *wp = cmdq->state.tflag.wp;
         struct window_pane              *wp = NULL;  
         struct format_tree              *ft;          struct format_tree              *ft;
         const char                      *cwd;          const char                      *cwd;
   
         if (args_has(args, 't')) {          cwd = wp->cwd;
                 wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp);  
                 cwd = wp->cwd;  
         } else {  
                 c = cmd_find_client(cmdq, NULL, 1);  
                 if (c != NULL && c->session != NULL) {  
                         s = c->session;  
                         wl = s->curw;  
                         wp = wl->window->active;  
                 }  
                 if (cmdq->client != NULL && cmdq->client->session == NULL)  
                         cwd = cmdq->client->cwd;  
                 else if (s != NULL)  
                         cwd = s->cwd;  
                 else  
                         cwd = NULL;  
         }  
   
           if (cmdq->client != NULL && cmdq->client->session == NULL)
                   cwd = cmdq->client->cwd;
           else if (s != NULL)
                   cwd = s->cwd;
           else
                   cwd = NULL;
         ft = format_create(cmdq, 0);          ft = format_create(cmdq, 0);
         format_defaults(ft, NULL, s, wl, wp);          format_defaults(ft, NULL, s, wl, wp);
         shellcmd = format_expand(ft, args->argv[0]);          shellcmd = format_expand(ft, args->argv[0]);

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38