OSSP CVS Repository

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

ossp-pkg/rc/rc_proc.c 1.50 -> 1.51

--- rc_proc.c    2003/06/27 14:26:13     1.50
+++ rc_proc.c    2003/06/30 14:43:36     1.51
@@ -88,10 +88,10 @@
         if ((nFdfunc = open(configGetval(RC_FNC_VAL), O_RDONLY)) >= 0) {
             /* Read data from the func file */
             while ((nRet = read(nFdfunc, sBuf, RC_READ_BUFSIZE)) > 0)
-                scriptAppend(pRc->m_pScriptfunc, sBuf, nRet);
+                scriptnAppend(pRc->m_pScriptfunc, sBuf, nRet);
             if (nRet == -1) /* Handle read errors */
                 RC_THROW(RC_ERR_IO);
-            scriptAppend(pRc->m_pScriptfunc, "\n", sizeof("\n"));
+            scriptnAppend(pRc->m_pScriptfunc, "\n", sizeof("\n"));
             close(nFdfunc); /* Close Func file handle */
         }
         else
@@ -110,8 +110,8 @@
         try { /* If it exists, append config section unconditionally */
             pSec = rcfileGetsec(pRcfile, configGetval(RC_NCF_VAL));
             if (pSec) { /* Only operate if the section lookup succeeds */
-                scriptAppend(pRc->m_pScriptcnf, sectionGetdata(pSec), strlen(sectionGetdata(pSec)));
-                scriptAppend(pRc->m_pScriptcnf, "\n", strlen ("\n"));
+                scriptAdd(pRc->m_pScriptcnf, sectionGetscript(pSec));
+                scriptnAppend(pRc->m_pScriptcnf, "\n", strlen ("\n"));
             }
 
             for (nSect = 0; nSect < nTotalsecs; nSect++) { /* Iterate over */
@@ -183,13 +183,13 @@
         /* Allocate a block of section pointers to use temporarily */
         ppSectmp = calloc(pRc->m_pList->m_nFiles, sizeof(rc_section_t *));
         pFatscript = scriptNew();
-        scriptAppend(pFatscript, RC_BANG_STR, strlen(RC_BANG_STR)); /* Shebang */
+        scriptnAppend(pFatscript, RC_BANG_STR, strlen(RC_BANG_STR)); /* Shebang */
         /* Conditionally output initial notice in verbal mode */
         if (configGetval(RC_VRB_VAL)) {
             szVerbose = malloc((strlen(RC_VST_TEXT) + 2) * sizeof (char));
             sprintf(szVerbose, "%s", RC_VST_TEXT);
             strcat(szVerbose, "\n");
-            scriptAppend(pFatscript, szVerbose, strlen(szVerbose));
+            scriptnAppend(pFatscript, szVerbose, strlen(szVerbose));
             free(szVerbose);
             szVerbose = NULL;
         }
@@ -198,7 +198,7 @@
             szVerbose = malloc((strlen(RC_EVF_TEXT) + 2) * sizeof (char));
             sprintf(szVerbose, "%s", RC_EVF_TEXT);
             strcat(szVerbose, "\n");
-            scriptAppend(pFatscript, szVerbose, strlen(szVerbose));
+            scriptnAppend(pFatscript, szVerbose, strlen(szVerbose));
             free(szVerbose);
             szVerbose = NULL;
         }
@@ -209,7 +209,7 @@
             szVerbose = malloc(nBytes);
             sprintf(szVerbose, RC_EVN_TEXT, RC_DEF_NCF, RC_DEF_NCF);
             strcat(szVerbose, "\n");
-            scriptAppend(pFatscript, szVerbose, strlen(szVerbose));
+            scriptnAppend(pFatscript, szVerbose, strlen(szVerbose));
             free(szVerbose);
             szVerbose = NULL;
         }
@@ -234,17 +234,16 @@
                     szVerbose = malloc(nBytes);
                     sprintf(szVerbose, RC_EVN_TEXT, szTmp, sectionGetparent(ppSectmp[nTmp]));
                     strcat(szVerbose, "\n");
-                    scriptAppend(pFatscript, szVerbose, strlen(szVerbose));
+                    scriptnAppend(pFatscript, szVerbose, strlen(szVerbose));
                     free(szVerbose);
                     szVerbose = NULL;
                 }
                 if ((szTmp = (char *)sectionGetlogin(ppSectmp[nTmp])) != NULL) {
-                    scriptAppend(pFatscript, "#su ", strlen("#su "));
-                    scriptAppend(pFatscript, szTmp, strlen(szTmp));
-                    scriptAppend(pFatscript, "\n", strlen("\n") + 1);
+                    scriptnAppend(pFatscript, "#su ", strlen("#su "));
+                    scriptnAppend(pFatscript, szTmp, strlen(szTmp));
+                    scriptnAppend(pFatscript, "\n", strlen("\n"));
                 }
-                szTmp = (char *)sectionGetdata(ppSectmp[nTmp]);
-                scriptAppend(pFatscript, szTmp, strlen(szTmp) + 1);
+                scriptAdd(pFatscript, sectionGetscript(ppSectmp[nTmp]));
             }
         }
         free(ppSectmp);
@@ -465,7 +464,7 @@
         /* Allocate a block of section pointers to use as a temporary */
         ppSectmp = calloc(pRc->m_pList->m_nFiles, sizeof(rc_section_t *));
         pBangscript = scriptNew();
-        scriptAppend(pBangscript, RC_BANG_STR, (strlen(RC_BANG_STR) + 1) * sizeof (char));
+        scriptnAppend(pBangscript, RC_BANG_STR, strlen(RC_BANG_STR));
         scriptDump(pBangscript); /* Dump the shebang */
         scriptDelete(pBangscript);
 

CVSTrac 2.0.1