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

Diff for /src/usr.bin/tmux/window.c between version 1.98 and 1.99

version 1.98, 2013/10/10 11:59:23 version 1.99, 2013/10/10 12:26:37
Line 309 
Line 309 
   
 struct window *  struct window *
 window_create(const char *name, const char *cmd, const char *shell,  window_create(const char *name, const char *cmd, const char *shell,
     const char *cwd, struct environ *env, struct termios *tio,      int cwd, struct environ *env, struct termios *tio,
     u_int sx, u_int sy, u_int hlimit, char **cause)      u_int sx, u_int sy, u_int hlimit, char **cause)
 {  {
         struct window           *w;          struct window           *w;
Line 675 
Line 675 
   
         wp->cmd = NULL;          wp->cmd = NULL;
         wp->shell = NULL;          wp->shell = NULL;
         wp->cwd = NULL;          wp->cwd = -1;
   
         wp->fd = -1;          wp->fd = -1;
         wp->event = NULL;          wp->event = NULL;
Line 730 
Line 730 
   
         RB_REMOVE(window_pane_tree, &all_window_panes, wp);          RB_REMOVE(window_pane_tree, &all_window_panes, wp);
   
         free(wp->cwd);          close(wp->cwd);
         free(wp->shell);          free(wp->shell);
         free(wp->cmd);          free(wp->cmd);
         free(wp);          free(wp);
Line 738 
Line 738 
   
 int  int
 window_pane_spawn(struct window_pane *wp, const char *cmd, const char *shell,  window_pane_spawn(struct window_pane *wp, const char *cmd, const char *shell,
     const char *cwd, struct environ *env, struct termios *tio, char **cause)      int cwd, struct environ *env, struct termios *tio, char **cause)
 {  {
         struct winsize   ws;          struct winsize   ws;
         char            *argv0, paneid[16];          char            *argv0, paneid[16];
Line 757 
Line 757 
                 free(wp->shell);                  free(wp->shell);
                 wp->shell = xstrdup(shell);                  wp->shell = xstrdup(shell);
         }          }
         if (cwd != NULL) {          if (cwd != -1) {
                 free(wp->cwd);                  close(wp->cwd);
                 wp->cwd = xstrdup(cwd);                  wp->cwd = dup(cwd);
         }          }
   
         log_debug("spawn: %s -- %s", wp->shell, wp->cmd);          log_debug("spawn: %s -- %s", wp->shell, wp->cmd);
Line 774 
Line 774 
                 xasprintf(cause, "%s: %s", cmd, strerror(errno));                  xasprintf(cause, "%s: %s", cmd, strerror(errno));
                 return (-1);                  return (-1);
         case 0:          case 0:
                 if (chdir(wp->cwd) != 0)                  if (fchdir(wp->cwd) != 0)
                         chdir("/");                          chdir("/");
   
                 if (tcgetattr(STDIN_FILENO, &tio2) != 0)                  if (tcgetattr(STDIN_FILENO, &tio2) != 0)

Legend:
Removed from v.1.98  
changed lines
  Added in v.1.99