--- rc_proc.c 2003/06/30 16:25:54 1.56
+++ rc_proc.c 2003/06/30 16:32:53 1.57
@@ -215,13 +215,12 @@
qsort((void *)ppSectmp, (size_t)pRc->m_pList->m_nFiles, \
sizeof(rc_section_t *), priCompare);
for (nTmp = 0; nTmp < pRc->m_pList->m_nFiles && ppSectmp[nTmp]; nTmp++) {
- /* Conditionally print config section notice in verbal mode */
if (configGetval(RC_VRB_VAL)) {
- /* Conditionally print config section notice in verbal mode */
- nBytes = (strlen(RC_PRN_TEXT) + strlen(RC_DEF_NCF) + \
+ /* Conditionally evaluate config section notice in verbal mode */
+ nBytes = (strlen(RC_EVN_TEXT) + strlen(RC_DEF_NCF) + \
strlen(sectionGetparent(ppSectmp[nTmp])) + 2) * sizeof (char);
szVerbose = malloc(nBytes);
- sprintf(szVerbose, RC_PRN_TEXT, RC_DEF_NCF, sectionGetparent(ppSectmp[nTmp]));
+ sprintf(szVerbose, RC_EVN_TEXT, RC_DEF_NCF, sectionGetparent(ppSectmp[nTmp]));
strcat(szVerbose, "\n");
scriptnAppend(pFatscript, szVerbose, strlen(szVerbose));
free(szVerbose);
@@ -229,6 +228,30 @@
}
scriptAdd(pFatscript, pRc->m_pScriptcnf);
+ /* Examine our list, and try to take the corresponding */
+ /* common section data from it to add to your script */
+ {
+ rc_section_t *pComsec = NULL;
+ pComsec = rcfileGetsec(listGetrcfile(pRc->m_pList, \
+ ppSectmp[nTmp]->m_szParent), configGetval(RC_CMN_VAL));
+ if (pComsec) { /* Do we have a common section to load? */
+ if (configGetval(RC_VRB_VAL)) {
+ szTmp = (char *)sectionGetname(pComsec);
+ nBytes = (strlen(RC_EVN_TEXT) + strlen(szTmp) + \
+ strlen (sectionGetparent(pComsec)) + \
+ strlen(RC_ECHO_STR) + strlen("\"\"") + 1) * \
+ sizeof (char);
+ szVerbose = malloc(nBytes);
+ sprintf(szVerbose, RC_EVN_TEXT, szTmp, sectionGetparent(pComsec));
+ strcat(szVerbose, "\n");
+ scriptnAppend(pFatscript, szVerbose, strlen(szVerbose));
+ free(szVerbose);
+ szVerbose = NULL;
+ }
+ scriptAdd(pFatscript, sectionGetscript(pComsec));
+ }
+ }
+
/* Conditionally print each section notice in verbal mode */
if (configGetval(RC_VRB_VAL)) {
szTmp = (char *)sectionGetname(ppSectmp[nTmp]);
@@ -519,7 +542,7 @@
if (pComsec) { /* Do we have a common section to load? */
if (configGetval(RC_VRB_VAL)) {
szTmp = (char *)sectionGetname(pComsec);
- nBytes = (strlen(RC_EXN_TEXT) + strlen(szTmp) + \
+ nBytes = (strlen(RC_PRN_TEXT) + strlen(szTmp) + \
strlen (sectionGetparent(pComsec)) + \
strlen(RC_ECHO_STR) + strlen("\"\"") + 1) * \
sizeof (char);
@@ -530,7 +553,7 @@
free(szVerbose);
szVerbose = NULL;
}
- sectionDump(pComsec);
+ sectionDump(pComsec);
}
}
|