Diff for /libaitcfg/src/parse.c between versions 1.8.4.3 and 1.8.4.4

version 1.8.4.3, 2012/07/30 11:23:09 version 1.8.4.4, 2012/07/30 11:44:35
Line 359  int Line 359  int
 cfgReadLines(FILE *f, const char *delim, const char *end, cfg_root_t * __restrict cfg)  cfgReadLines(FILE *f, const char *delim, const char *end, cfg_root_t * __restrict cfg)
 {  {
         char line[BUFSIZ];          char line[BUFSIZ];
        struct tagCfg *av = NULL;        struct tagCfg *d, *av = NULL;
         char *psAttr, *psVal = NULL;          char *psAttr, *psVal = NULL;
   
         while (!feof(f)) {          while (!feof(f)) {
Line 391  cfgReadLines(FILE *f, const char *delim, const char *e Line 391  cfgReadLines(FILE *f, const char *delim, const char *e
                 if (!av) {                  if (!av) {
                         LOGERR;                          LOGERR;
                         return -1;                          return -1;
                } else {                } else
                         memset(av, 0, sizeof(struct tagCfg));                          memset(av, 0, sizeof(struct tagCfg));
                         CFG_RC_LOCK(cfg);  
                         SLIST_INSERT_HEAD(cfg, av, cfg_next);  
                         CFG_RC_UNLOCK(cfg);  
                 }  
   
                 if (psVal)                  if (psVal)
                         AIT_SET_STR(&av->cfg_val, psVal);                          AIT_SET_STR(&av->cfg_val, psVal);
Line 405  cfgReadLines(FILE *f, const char *delim, const char *e Line 401  cfgReadLines(FILE *f, const char *delim, const char *e
                                 io_align(AIT_LEN(&av->cfg_attr) - 1, 1) / 2);                                  io_align(AIT_LEN(&av->cfg_attr) - 1, 1) / 2);
   
                 CFG_RC_LOCK(cfg);                  CFG_RC_LOCK(cfg);
                   /* find & delete duplicates */
                   if ((d = RB_FIND(tagRC, cfg, av))) {
                           RB_REMOVE(tagRC, cfg, d);
                           SLIST_REMOVE(cfg, d, tagCfg, cfg_next);
   
                           AIT_FREE_VAL(&d->cfg_val);
                           AIT_FREE_VAL(&d->cfg_attr);
                           AIT_FREE_VAL(&d->cfg_sec);
                           io_free(d);
                   }
   
                   SLIST_INSERT_HEAD(cfg, av, cfg_next);
                 RB_INSERT(tagRC, cfg, av);                  RB_INSERT(tagRC, cfg, av);
                 CFG_RC_UNLOCK(cfg);                  CFG_RC_UNLOCK(cfg);
         }          }

Removed from v.1.8.4.3  
changed lines
  Added in v.1.8.4.4


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>