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

Diff for /src/usr.bin/tmux/cmd-new-session.c between version 1.107 and 1.108

version 1.107, 2017/05/28 19:46:55 version 1.108, 2017/07/21 09:17:19
Line 74 
Line 74 
         struct termios           tio, *tiop;          struct termios           tio, *tiop;
         struct session_group    *sg;          struct session_group    *sg;
         const char              *newname, *errstr, *template, *group, *prefix;          const char              *newname, *errstr, *template, *group, *prefix;
         const char              *path, *cmd, *cwd, *to_free = NULL;          const char              *path, *cmd, *cwd;
         char                   **argv, *cause, *cp;          char                   **argv, *cause, *cp, *to_free = NULL;
         int                      detached, already_attached, idx, argc;          int                      detached, already_attached, idx, argc;
         int                      is_control = 0;          int                      is_control = 0;
         u_int                    sx, sy;          u_int                    sx, sy;
Line 151 
Line 151 
         /* Get the new session working directory. */          /* Get the new session working directory. */
         if (args_has(args, 'c')) {          if (args_has(args, 'c')) {
                 cwd = args_get(args, 'c');                  cwd = args_get(args, 'c');
                 to_free = cwd = format_single(item, cwd, c, NULL, NULL, NULL);                  to_free = format_single(item, cwd, c, NULL, NULL, NULL);
                   cwd = to_free;
         } else if (c != NULL && c->session == NULL && c->cwd != NULL)          } else if (c != NULL && c->session == NULL && c->cwd != NULL)
                 cwd = c->cwd;                  cwd = c->cwd;
         else          else
Line 327 
Line 328 
                 cmd_find_from_session(&item->shared->current, s);                  cmd_find_from_session(&item->shared->current, s);
         }          }
   
         if (to_free != NULL)  
                 free((void *)to_free);  
   
         cmd_find_from_session(&fs, s);          cmd_find_from_session(&fs, s);
         hooks_insert(s->hooks, item, &fs, "after-new-session");          hooks_insert(s->hooks, item, &fs, "after-new-session");
   
           free(to_free);
         return (CMD_RETURN_NORMAL);          return (CMD_RETURN_NORMAL);
   
 error:  error:
         if (to_free != NULL)          free(to_free);
                 free((void *)to_free);  
         return (CMD_RETURN_ERROR);          return (CMD_RETURN_ERROR);
 }  }

Legend:
Removed from v.1.107  
changed lines
  Added in v.1.108