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

Diff for /src/usr.bin/tmux/cfg.c between version 1.40 and 1.41

version 1.40, 2015/09/01 10:01:56 version 1.41, 2015/09/01 10:10:59
Line 28 
Line 28 
   
 #include "tmux.h"  #include "tmux.h"
   
   char             *cfg_file;
 struct cmd_q     *cfg_cmd_q;  struct cmd_q     *cfg_cmd_q;
 int               cfg_finished;  int               cfg_finished;
 int               cfg_references;  int               cfg_references;
Line 38 
Line 39 
 void    cfg_default_done(struct cmd_q *);  void    cfg_default_done(struct cmd_q *);
   
 void  void
   set_cfg_file(const char *path)
   {
           free(cfg_file);
           cfg_file = xstrdup(path);
   }
   
   void
 start_cfg(void)  start_cfg(void)
 {  {
         char    *cause = NULL;          char            *cause = NULL;
           const char      *home;
   
         cfg_cmd_q = cmdq_new(NULL);          cfg_cmd_q = cmdq_new(NULL);
         cfg_cmd_q->emptyfn = cfg_default_done;          cfg_cmd_q->emptyfn = cfg_default_done;
Line 58 
Line 67 
         } else if (errno != ENOENT)          } else if (errno != ENOENT)
                 cfg_add_cause("%s: %s", TMUX_CONF, strerror(errno));                  cfg_add_cause("%s: %s", TMUX_CONF, strerror(errno));
   
           if (cfg_file == NULL && (home = find_home()) != NULL) {
                   xasprintf(&cfg_file, "%s/.tmux.conf", home);
                   if (access(cfg_file, R_OK) != 0 && errno == ENOENT) {
                           free(cfg_file);
                           cfg_file = NULL;
                   }
           }
         if (cfg_file != NULL && load_cfg(cfg_file, cfg_cmd_q, &cause) == -1)          if (cfg_file != NULL && load_cfg(cfg_file, cfg_cmd_q, &cause) == -1)
                 cfg_add_cause("%s: %s", cfg_file, cause);                  cfg_add_cause("%s: %s", cfg_file, cause);
         free(cause);          free(cause);

Legend:
Removed from v.1.40  
changed lines
  Added in v.1.41