OSSP CVS Repository

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

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

--- rc_proc.c    2003/06/30 15:27:38     1.53
+++ rc_proc.c    2003/06/30 15:58:49     1.54
@@ -168,7 +168,6 @@
     char *szExec    = NULL;             /* Used only during exec mode      */
     char *szVerbose = NULL;             /* Used when handling verbose mode */
     char *pszVec[RC_EXEC_MAXARGS];      /* For passing in to execv(3)      */
-    rc_script_t   *pBangscript = NULL;  /* Common script with the shebang  */
     rc_script_t   *pFatscript  = NULL;  /* To build a comprehensive script */
     rc_section_t **ppSectmp    = NULL;  /* Used with priority scheduling   */
     short          nTotalsecs  = vectorCount(configGetsecs()); /* Sections */
@@ -323,8 +322,9 @@
                     size_t nSection = 0;
 
                     /* Allocate space just for string to prepare for verbose */
-                    nSizverb = (strlen(RC_EXN_TEXT) + strlen(RC_DEF_NCF) * 2 \
-                        + strlen(RC_ECHO_STR) + strlen("\"\"") + 1) * sizeof (char);
+                    nSizverb = (strlen(RC_EXN_TEXT) + strlen(RC_DEF_NCF) + \
+                        strlen(sectionGetparent(ppSectmp[nTmp])) + strlen(RC_ECHO_STR) + \
+                        strlen("\"\"") + 1) * sizeof (char);
                     szVerbose = malloc(nSizverb);
                     sprintf(szVerbose, RC_EXN_TEXT, RC_DEF_NCF, sectionGetparent(ppSectmp[nTmp]));
 
@@ -469,10 +469,6 @@
     else if (configGetval(RC_PRN_VAL)) {                        /* Print  */
         /* Allocate a block of section pointers to use as a temporary */
         ppSectmp = calloc(pRc->m_pList->m_nFiles, sizeof(rc_section_t *));
-        pBangscript = scriptNew();
-        scriptnAppend(pBangscript, RC_BANG_STR, strlen(RC_BANG_STR));
-        scriptDump(pBangscript); /* Dump the shebang */
-        scriptDelete(pBangscript);
 
         /* Conditionally output initial notice in verbal mode */
         if (configGetval(RC_VRB_VAL))
@@ -481,17 +477,6 @@
         if (configGetval(RC_VRB_VAL))
             fprintf(stderr, "%s\n", RC_PNF_TEXT);
         scriptDump(pRc->m_pScriptfunc); /* Dump the funcs script */
-        /* Conditionally print config section notice in verbal mode */
-        if (configGetval(RC_VRB_VAL)) {
-            nBytes = (strlen(RC_PRN_TEXT) + strlen(RC_DEF_NCF) * 2 + 2) * sizeof (char);
-            szVerbose = malloc(nBytes);
-            sprintf(szVerbose, RC_PRN_TEXT, RC_DEF_NCF, RC_DEF_NCF);
-            strcat(szVerbose, "\n");
-            fprintf(stderr, szVerbose);
-            free(szVerbose);
-            szVerbose = NULL;
-        }
-        scriptDump(pRc->m_pScriptcnf);  /* Dump the config script */
 
         for (nSecs = 0; nSecs < nTotalsecs; nSecs++) {
             for (nRcs = 0; nRcs < pRc->m_pList->m_nFiles; nRcs++) {
@@ -505,12 +490,26 @@
             }
             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 each 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) + \
+                        strlen(sectionGetparent(ppSectmp[nTmp])) + 2) * sizeof (char);
+                    szVerbose = malloc(nBytes);
+                    sprintf(szVerbose, RC_PRN_TEXT, RC_DEF_NCF, sectionGetparent(ppSectmp[nTmp]));
+                    strcat(szVerbose, "\n");
+                    fprintf(stderr, szVerbose);
+                    free(szVerbose);
+                    szVerbose = NULL;
+                }
+                scriptDump(pRc->m_pScriptcnf);  /* Dump the config script */
+
+                if (configGetval(RC_VRB_VAL)) {
+                    /* Conditionally print each section notice in verbal mode */
                     szTmp = (char *)sectionGetname(ppSectmp[nTmp]);
-                    nBytes = (strlen(RC_PRN_TEXT) + strlen(szTmp) + 1) * sizeof (char);
+                    nBytes = (strlen(RC_PRN_TEXT) + strlen(szTmp) + 2) * sizeof (char);
                     szVerbose = malloc(nBytes);
                     sprintf(szVerbose, RC_PRN_TEXT, szTmp, sectionGetparent(ppSectmp[nTmp]));
+                    strcat(szVerbose, "\n");
                     fprintf(stderr, "%s", szVerbose);
                     free(szVerbose);
                     szVerbose = NULL;

CVSTrac 2.0.1