--- rc_proc.c 2002/08/02 20:09:59 1.17
+++ rc_proc.c 2003/04/03 12:05:14 1.18
@@ -152,25 +152,20 @@
/* FIXME: Swap nested rcfile/section logic loops for section/rcfile ordering */
for (i = 0; pRc->m_pAnal->m_pszSecs[i]; i++) { /* Iterate over */
/* Extract a section from the temp script, and append it */
- szSec = scriptSection(pTempscript, pRc->m_pAnal->m_pszSecs[i]);
+ pSec = scriptSection(pTempscript, pRc->m_pAnal->m_pszSecs[i]);
- if (szSec) { /* Only call if the section lookup succeeds */
- scriptAppend(ppParts[nIter], szSec, strlen(szSec));
+ if (pSec) { /* Only call if the section lookup succeeds */
+ scriptAppend(ppParts[nIter], sectionGetdata(pSec),
+ sectionGetlen(pSec) - 1);
scriptAppend(pRc->m_pScript, "\n", sizeof(char));
}
-/* if (szSec) { -* Only call if the section lookup succeeds *-
- scriptAppend(pRc->m_pScript, szSec, strlen(szSec));
- scriptAppend(pRc->m_pScript, "\n", sizeof(char));
- }
- else if (configGetval(RC_DBG_VAL)) -* Only show if debug set *-
+ else if (configGetval(RC_DBG_VAL)) /* Only show if debug set */
fprintf(stderr, "#Warning: Missing section '%s' in %s!\n",\
pRc->m_pAnal->m_pszSecs[i],\
- pRc->m_pAnal->m_szRcs[nIter]);*/
+ pRc->m_pAnal->m_szRcs[nIter]);
- if (szSec) { /* Cleanup iterative section string */
- free(szSec);
- szSec = NULL;
- }
+ if (pSec) /* Cleanup iterative section string */
+ sectionDelete(pSec);
}
}
catch(Except)
@@ -192,6 +187,7 @@
if (ppParts[nRept]) {
free(ppParts[nRept]);
ppParts[nRept] = NULL;
+ }
}
free(ppParts);
ppParts = NULL;
|