[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.32 and 1.33

version 1.32, 2014/06/25 19:17:27 version 1.33, 2014/10/27 22:23:47
Line 30 
Line 30 
 struct cmd_q            *cfg_cmd_q;  struct cmd_q            *cfg_cmd_q;
 int                      cfg_finished;  int                      cfg_finished;
 int                      cfg_references;  int                      cfg_references;
 struct causelist         cfg_causes;  ARRAY_DECL (, char *)    cfg_causes = ARRAY_INITIALIZER;
 struct client           *cfg_client;  struct client           *cfg_client;
   
 int  int
Line 40 
Line 40 
         char             delim[3] = { '\\', '\\', '\0' };          char             delim[3] = { '\\', '\\', '\0' };
         u_int            found;          u_int            found;
         size_t           line = 0;          size_t           line = 0;
         char            *buf, *cause1, *msg, *p;          char            *buf, *cause1, *p;
         struct cmd_list *cmdlist;          struct cmd_list *cmdlist;
   
         log_debug("loading %s", path);          log_debug("loading %s", path);
Line 67 
Line 67 
                         free(buf);                          free(buf);
                         if (cause1 == NULL)                          if (cause1 == NULL)
                                 continue;                                  continue;
                         xasprintf(&msg, "%s:%zu: %s", path, line, cause1);                          cfg_add_cause("%s:%zu: %s", path, line, cause1);
                         ARRAY_ADD(&cfg_causes, msg);  
                         free(cause1);                          free(cause1);
                         continue;                          continue;
                 }                  }
Line 111 
Line 110 
                 cfg_client->references--;                  cfg_client->references--;
                 cfg_client = NULL;                  cfg_client = NULL;
         }          }
   }
   
   void
   cfg_add_cause(const char* fmt, ...)
   {
           va_list ap;
           char*   msg;
   
           va_start(ap, fmt);
           xvasprintf(&msg, fmt, ap);
           va_end (ap);
   
           ARRAY_ADD(&cfg_causes, msg);
   }
   
   void
   cfg_print_causes(struct cmd_q *cmdq)
   {
           char    *cause;
           u_int    i;
   
           for (i = 0; i < ARRAY_LENGTH(&cfg_causes); i++) {
                   cause = ARRAY_ITEM(&cfg_causes, i);
                   cmdq_print(cmdq, "%s", cause);
                   free(cause);
           }
           ARRAY_FREE(&cfg_causes);
 }  }
   
 void  void

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.33