--- ray/src/util/eplus_idf.c 2014/02/09 05:49:21 2.4 +++ ray/src/util/eplus_idf.c 2014/02/10 04:51:26 2.6 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: eplus_idf.c,v 2.4 2014/02/09 05:49:21 greg Exp $"; +static const char RCSid[] = "$Id: eplus_idf.c,v 2.6 2014/02/10 04:51:26 greg Exp $"; #endif /* * eplus_idf.c @@ -44,6 +44,7 @@ idf_newparam(IDF_LOADED *idf, const char *pname, const if (pnew == NULL) return(NULL); strcpy(pnew->rem, comm); + pnew->nfield = 0; pnew->flist = NULL; pnew->pname = pent->key; /* add to table */ pnew->pnext = (IDF_PARAMETER *)pent->data; @@ -76,7 +77,7 @@ idf_addfield(IDF_PARAMETER *param, const char *fval, c if (fnew == NULL) return(0); fnew->next = NULL; - cp = fnew->arg; /* copy argument and comments */ + cp = fnew->val; /* copy value and comments */ while ((*cp++ = *fval++)) ; fnew->rem = cp; @@ -94,6 +95,7 @@ idf_addfield(IDF_PARAMETER *param, const char *fval, c param->flist = fnew; else flast->next = fnew; + param->nfield++; return(fnum); } @@ -365,8 +367,8 @@ idf_writeparam(IDF_PARAMETER *param, FILE *fp, int inc fputs(param->rem, fp); for (fptr = param->flist; fptr != NULL; fptr = fptr->next) { if (!incl_comm) - fputs("\n\t", fp); - fputs(fptr->arg, fp); + fputs("\n ", fp); + fputs(fptr->val, fp); fputc((fptr->next==NULL ? ';' : ','), fp); if (incl_comm) fputs(fptr->rem, fp);