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

version 1.8.4.2, 2012/07/30 10:45:16 version 1.8.4.3, 2012/07/30 11:23:09
Line 361  cfgReadLines(FILE *f, const char *delim, const char *e Line 361  cfgReadLines(FILE *f, const char *delim, const char *e
         char line[BUFSIZ];          char line[BUFSIZ];
         struct tagCfg *av = NULL;          struct tagCfg *av = NULL;
         char *psAttr, *psVal = NULL;          char *psAttr, *psVal = NULL;
         int ret;  
   
         while (!feof(f)) {          while (!feof(f)) {
                 memset(line, 0, sizeof line);                  memset(line, 0, sizeof line);
                 fgets(line, sizeof line - 1, f);                  fgets(line, sizeof line - 1, f);
                 /* check for user end-of-file */                  /* check for user end-of-file */
                if (!strspn(line, end))                if (strspn(line, end))
                         break;                          break;
   
                 if (!(psAttr = strpbrk(line, "\r\n"))) {                  if (!(psAttr = strpbrk(line, "\r\n"))) {
Line 380  cfgReadLines(FILE *f, const char *delim, const char *e Line 379  cfgReadLines(FILE *f, const char *delim, const char *e
                                 continue;                                  continue;
                 }                  }
   
                ret = io_MakeAV2((char**) &line, delim, psAttr, psVal);                if (!io_MakeAV2(line, delim, &psAttr, &psVal))
                io_LTrimStr(psVal);                        continue;
                io_RTrimStr(psAttr);                else {
                         io_LTrimStr(psVal);
                         io_RTrimStr(psAttr);
                 }
   
                 /* *NEW PAIR* alloc new pair element */                  /* *NEW PAIR* alloc new pair element */
                 av = io_malloc(sizeof(struct tagCfg));                  av = io_malloc(sizeof(struct tagCfg));
Line 396  cfgReadLines(FILE *f, const char *delim, const char *e Line 398  cfgReadLines(FILE *f, const char *delim, const char *e
                         CFG_RC_UNLOCK(cfg);                          CFG_RC_UNLOCK(cfg);
                 }                  }
   
                AIT_SET_STR(&av->cfg_val, psVal ? psVal : "");                if (psVal)
                         AIT_SET_STR(&av->cfg_val, psVal);
                 AIT_SET_STR(&av->cfg_attr, psAttr);                  AIT_SET_STR(&av->cfg_attr, psAttr);
                 AIT_KEY(&av->cfg_attr) = crcFletcher16(AIT_GET_LIKE(&av->cfg_attr, u_short*),                   AIT_KEY(&av->cfg_attr) = crcFletcher16(AIT_GET_LIKE(&av->cfg_attr, u_short*), 
                                 io_align(AIT_LEN(&av->cfg_attr) - 1, 1) / 2);                                  io_align(AIT_LEN(&av->cfg_attr) - 1, 1) / 2);

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


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