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

Diff for /src/usr.bin/tmux/cmd-attach-session.c between version 1.45 and 1.46

version 1.45, 2015/10/28 09:51:55 version 1.46, 2015/10/31 08:13:58
Line 51 
Line 51 
         struct window_pane      *wp = NULL;          struct window_pane      *wp = NULL;
         const char              *update;          const char              *update;
         char                    *cause;          char                    *cause;
         int                      fd;  
         struct format_tree      *ft;          struct format_tree      *ft;
         char                    *cp;          char                    *cwd;
   
         if (RB_EMPTY(&sessions)) {          if (RB_EMPTY(&sessions)) {
                 cmdq_error(cmdq, "no sessions");                  cmdq_error(cmdq, "no sessions");
Line 97 
Line 96 
                 ft = format_create();                  ft = format_create();
                 format_defaults(ft, cmd_find_client(cmdq, NULL, 1), s,                  format_defaults(ft, cmd_find_client(cmdq, NULL, 1), s,
                     NULL, NULL);                      NULL, NULL);
                 cp = format_expand(ft, cflag);                  cwd = format_expand(ft, cflag);
                 format_free(ft);                  format_free(ft);
   
                 fd = open(cp, O_RDONLY|O_DIRECTORY);                  if (access(cwd, X_OK) != 0) {
                 free(cp);                          free((void *)cwd);
                 if (fd == -1) {  
                         cmdq_error(cmdq, "bad working directory: %s",                          cmdq_error(cmdq, "bad working directory: %s",
                             strerror(errno));                              strerror(errno));
                         return (CMD_RETURN_ERROR);                          return (CMD_RETURN_ERROR);
                 }                  }
                 close(s->cwd);                  free((void *)s->cwd);
                 s->cwd = fd;                  s->cwd = cwd;
         }          }
   
         if (c->session != NULL) {          if (c->session != NULL) {

Legend:
Removed from v.1.45  
changed lines
  Added in v.1.46