Index: ossp-pkg/rc/00TODO RCS File: /v/ossp/cvs/ossp-pkg/rc/00TODO,v rcsdiff -q -kk '-r1.32' '-r1.33' -u '/v/ossp/cvs/ossp-pkg/rc/00TODO,v' 2>/dev/null --- 00TODO 2002/07/30 16:36:41 1.32 +++ 00TODO 2002/08/01 09:45:19 1.33 @@ -17,6 +17,8 @@ Not efficient (reads whole files when only parts are needed...) What's going on with ^ in patterns? Something is broken. Resolve memory leaks with Dmalloc, ask for help. + Rc file prefix rc. is hardcoded, and when wildcard is given, the prefix is + used in selecting files. Location is not properly used. See rc_anal.c. Document Refs, pri, user, group, ci, go only in normal (not special) sections. Index: ossp-pkg/rc/rc_anal.c RCS File: /v/ossp/cvs/ossp-pkg/rc/Attic/rc_anal.c,v rcsdiff -q -kk '-r1.9' '-r1.10' -u '/v/ossp/cvs/ossp-pkg/rc/Attic/rc_anal.c,v' 2>/dev/null --- rc_anal.c 2002/08/01 08:55:05 1.9 +++ rc_anal.c 2002/08/01 09:45:19 1.10 @@ -64,6 +64,7 @@ else { /* Only enter block with valid string, strdup can't handle NULL */ (*ppInst)->m_szRcs = malloc(sizeof(char **)); if (strcmp(kszName, RC_GLOB_WILD)) { + (*ppInst)->m_szRcs = malloc(sizeof(*((*ppInst)->m_szRcs))); *(*ppInst)->m_szRcs = strdup("rc."); /* FIXME: Remove hardcoded */ strcat(*(*ppInst)->m_szRcs, kszName); } @@ -184,8 +185,8 @@ rc_return_t analGloblocs(rc_anal_t **ppInst) { struct dirent ***pppFiles = NULL; - int nIter = 0; - int nCount = 0; + int nCount = 0; /* How many globbed files we find */ + int nIter = 0; /* Iterate over the number of globbed files */ assert(*ppInst); /* Verify sanity */ @@ -193,11 +194,13 @@ pppFiles = malloc(sizeof(struct dirent)); nCount = scandir((*ppInst)->m_szLocs, pppFiles, analFileselect, alphasort); - /* Check out the health of this directory */ + /* Check out the health of this directory listing */ if (nCount == -1) return(RC_THROW(RC_ERR_DIR)); + else /* Allocate for the string array to hold directory entry names */ + (*ppInst)->m_szRcs = malloc(sizeof((*((*ppInst)->m_szRcs))) * (nCount + 1)); - /* Loop through file index setting Rf file names according to dirent */ + /* Loop through file index setting rc file names according to dirent */ for (nIter = 0; nIter < nCount; ++nIter) (*ppInst)->m_szRcs[nIter] = strdup((*pppFiles)[nIter]->d_name); (*ppInst)->m_szRcs[nIter] = NULL; @@ -239,6 +242,9 @@ ************************************************/ rc_return_t analDelete(rc_anal_t *pInst) { +/* FIXME: It could be that pInst needs to be a double pointer to */ +/* be properly used in destruction. Otherwise members are */ +/* just copies of the stack parameters passed in. */ int nIter = 0; while (pInst->m_szRcs[nIter]) /* Rc file names */