OSSP CVS Repository

ossp - Difference in ossp-pkg/rc/rc_proc.c versions 1.54 and 1.55
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/rc/rc_proc.c 1.54 -> 1.55

--- rc_proc.c    2003/06/30 15:58:49     1.54
+++ rc_proc.c    2003/06/30 16:14:58     1.55
@@ -360,8 +360,10 @@
                             ppSectmp[nTmp]->m_szParent), configGetval(RC_CMN_VAL));
                         if (pComsec) { /* If we have a common section to load,  */
                             szTmp = (char *)sectionGetname(pComsec);
-                            nSecverb = (strlen(RC_EXN_TEXT) + strlen(szTmp) * 2 \
-                                + strlen(RC_ECHO_STR) + strlen("\"\"") + 1) * sizeof (char);
+                            nSecverb = (strlen(RC_EXN_TEXT) + strlen(szTmp) + \
+                                strlen (sectionGetparent(pComsec)) + \
+                                strlen(RC_ECHO_STR) + strlen("\"\"") + 1) * \
+                                sizeof (char);
                             realloc(szVerbose, nSecverb);
                             sprintf(szVerbose, RC_EXN_TEXT, szTmp, sectionGetparent(pComsec));
                             nSection = (strlen(szTmp) + 1) * sizeof (char);
@@ -503,6 +505,30 @@
                 }
                 scriptDump(pRc->m_pScriptcnf);  /* Dump the config script */
 
+                /* 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_EXN_TEXT) + strlen(szTmp) + \
+                                strlen (sectionGetparent(pComsec)) + \
+                                strlen(RC_ECHO_STR) + strlen("\"\"") + 1) * \
+                                sizeof (char);
+                            szVerbose = malloc(nBytes);
+                            sprintf(szVerbose, RC_PRN_TEXT, szTmp, sectionGetparent(pComsec));
+                            strcat(szVerbose, "\n");
+                            fprintf(stderr, "%s", szVerbose);
+                            free(szVerbose);
+                            szVerbose = NULL;
+                        }
+                    sectionDump(pComsec);
+                    }
+                }
+
                 if (configGetval(RC_VRB_VAL)) {
                     /* Conditionally print each section notice in verbal mode */
                     szTmp = (char *)sectionGetname(ppSectmp[nTmp]);

CVSTrac 2.0.1