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

Diff for /src/usr.bin/tmux/cmd-respawn-window.c between version 1.20 and 1.21

version 1.20, 2013/10/10 12:29:53 version 1.21, 2014/04/17 13:02:59
Line 47 
Line 47 
         struct window_pane      *wp;          struct window_pane      *wp;
         struct session          *s;          struct session          *s;
         struct environ           env;          struct environ           env;
         const char              *cmd;          const char              *cmd, *path;
         char                    *cause;          char                    *cause;
           struct environ_entry    *envent;
   
         if ((wl = cmd_find_window(cmdq, args_get(args, 't'), &s)) == NULL)          if ((wl = cmd_find_window(cmdq, args_get(args, 't'), &s)) == NULL)
                 return (CMD_RETURN_ERROR);                  return (CMD_RETURN_ERROR);
Line 79 
Line 80 
                 cmd = args->argv[0];                  cmd = args->argv[0];
         else          else
                 cmd = NULL;                  cmd = NULL;
         if (window_pane_spawn(wp, cmd, NULL, -1, &env, s->tio, &cause) != 0) {  
           path = NULL;
           if (cmdq->client != NULL && cmdq->client->session == NULL)
                   envent = environ_find(&cmdq->client->environ, "PATH");
           else
                   envent = environ_find(&s->environ, "PATH");
           if (envent != NULL)
                   path = envent->value;
   
           if (window_pane_spawn(wp, cmd, path, NULL, -1, &env, s->tio,
               &cause) != 0) {
                 cmdq_error(cmdq, "respawn window failed: %s", cause);                  cmdq_error(cmdq, "respawn window failed: %s", cause);
                 free(cause);                  free(cause);
                 environ_free(&env);                  environ_free(&env);

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21