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

Diff for /src/usr.bin/tmux/tmux.c between version 1.125 and 1.126

version 1.125, 2013/10/10 12:26:36 version 1.126, 2013/10/10 12:29:35
Line 49 
Line 49 
 char             socket_path[MAXPATHLEN];  char             socket_path[MAXPATHLEN];
 int              login_shell;  int              login_shell;
 char            *environ_path;  char            *environ_path;
 pid_t            environ_pid = -1;  
 int              environ_session_id = -1;  
   
 __dead void      usage(void);  __dead void      usage(void);
 void             parseenvironment(void);  
 char            *makesocketpath(const char *);  char            *makesocketpath(const char *);
   
 __dead void  __dead void
Line 124 
Line 121 
         return (0);          return (0);
 }  }
   
 void  
 parseenvironment(void)  
 {  
         char    *env, path[256];  
         long     pid;  
         int      id;  
   
         if ((env = getenv("TMUX")) == NULL)  
                 return;  
   
         if (sscanf(env, "%255[^,],%ld,%d", path, &pid, &id) != 3)  
                 return;  
         environ_path = xstrdup(path);  
         environ_pid = pid;  
         environ_session_id = id;  
 }  
   
 char *  char *
 makesocketpath(const char *label)  makesocketpath(const char *label)
 {  {
Line 223 
Line 203 
 {  {
         struct passwd   *pw;          struct passwd   *pw;
         char            *s, *path, *label, *home, **var, tmp[MAXPATHLEN];          char            *s, *path, *label, *home, **var, tmp[MAXPATHLEN];
         int              opt, flags, quiet, keys;          char             in[256];
           long long        pid;
           int              opt, flags, quiet, keys, session;
   
 #ifdef DEBUG  #ifdef DEBUG
         malloc_options = (char *) "AFGJPX";          malloc_options = (char *) "AFGJPX";
Line 351 
Line 333 
                 }                  }
         }          }
   
           /* Get path from environment. */
           s = getenv("TMUX");
           if (s != NULL && sscanf(s, "%255[^,],%lld,%d", in, &pid, &session) == 3)
                   environ_path = xstrdup(in);
   
         /*          /*
          * Figure out the socket path. If specified on the command-line with -S           * Figure out the socket path. If specified on the command-line with -S
          * or -L, use it, otherwise try $TMUX or assume -L default.           * or -L, use it, otherwise try $TMUX or assume -L default.
          */           */
         parseenvironment();  
         if (path == NULL) {          if (path == NULL) {
                 /* If no -L, use the environment. */                  /* If no -L, use the environment. */
                 if (label == NULL) {                  if (label == NULL) {

Legend:
Removed from v.1.125  
changed lines
  Added in v.1.126