[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.141 and 1.142

version 1.141, 2015/08/30 22:56:36 version 1.142, 2015/09/01 10:10:59
Line 41 
Line 41 
 struct options   global_w_options;      /* window options */  struct options   global_w_options;      /* window options */
 struct environ   global_environ;  struct environ   global_environ;
   
 char            *cfg_file;  
 char            *shell_cmd;  char            *shell_cmd;
 int              debug_level;  int              debug_level;
 time_t           start_time;  time_t           start_time;
Line 171 
Line 170 
 const char *  const char *
 find_home(void)  find_home(void)
 {  {
         struct passwd   *pw;          struct passwd           *pw;
         const char      *home;          static const char       *home;
   
           if (home != NULL)
                   return (home);
   
         home = getenv("HOME");          home = getenv("HOME");
         if (home == NULL || *home == '\0') {          if (home == NULL || *home == '\0') {
                 pw = getpwuid(getuid());                  pw = getpwuid(getuid());
Line 189 
Line 191 
 int  int
 main(int argc, char **argv)  main(int argc, char **argv)
 {  {
         char            *s, *path, *label, **var, tmp[PATH_MAX];          char    *s, *path, *label, **var, tmp[PATH_MAX];
         const char      *home;          int      opt, flags, keys;
         int              opt, flags, keys;  
   
 #ifdef DEBUG  #ifdef DEBUG
         malloc_options = (char *) "AFGJPX";          malloc_options = (char *) "AFGJPX";
Line 221 
Line 222 
                                 flags |= CLIENT_CONTROL;                                  flags |= CLIENT_CONTROL;
                         break;                          break;
                 case 'f':                  case 'f':
                         free(cfg_file);                          set_cfg_file(optarg);
                         cfg_file = xstrdup(optarg);  
                         break;                          break;
                 case 'l':                  case 'l':
                         flags |= CLIENT_LOGIN;                          flags |= CLIENT_LOGIN;
Line 304 
Line 304 
                         keys = MODEKEY_EMACS;                          keys = MODEKEY_EMACS;
                 options_set_number(&global_s_options, "status-keys", keys);                  options_set_number(&global_s_options, "status-keys", keys);
                 options_set_number(&global_w_options, "mode-keys", keys);                  options_set_number(&global_w_options, "mode-keys", keys);
         }  
   
         /* Locate the configuration file. */  
         if (cfg_file == NULL) {  
                 home = find_home();  
                 if (home != NULL) {  
                         xasprintf(&cfg_file, "%s/.tmux.conf", home);  
                         if (access(cfg_file, R_OK) != 0 && errno == ENOENT) {  
                                 free(cfg_file);  
                                 cfg_file = NULL;  
                         }  
                 }  
         }          }
   
         /*          /*

Legend:
Removed from v.1.141  
changed lines
  Added in v.1.142