Changeset 151 for trunk/src/helpers/configsys.c
- Timestamp:
- Mar 26, 2002, 8:02:50 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/configsys.c
r129 r151 547 547 * by \n ONLY. If *ppszContents has \r\n line breaks, 548 548 * they must be converted to pure \n first. 549 * 550 *@@changed V0.9.18 (2002-03-24) [umoeller]: fixed leftover duplicate ';' chars with CFGRPL_REMOVEPART 549 551 */ 550 552 … … 814 816 if ((pArgToDel = strhistr(pszDeletedLine, pszArgNew))) 815 817 { 816 ULONG ulOfs = 0;818 // ULONG ulOfs = 0; 817 819 // pArgToDel now has the position of the 818 820 // part to be deleted in the old part 819 pszLineToInsert = strdup(pszDeletedLine);821 /* pszLineToInsert = strdup(pszDeletedLine); 820 822 strhFindReplace(&pszLineToInsert, 821 823 &ulOfs, 822 824 pszArgNew, // search string 823 825 ""); // replacement string 826 */ 827 828 // V0.9.18 (2002-03-24) [umoeller] 829 // the above left duplicate ";" characters in the line 830 ULONG ulArgNewLen = strlen(pszArgNew); 831 ULONG cbFirst, cb; 832 PSZ pAfter = pArgToDel + ulArgNewLen; 833 while (*pAfter == ';') 834 ++pAfter; 835 836 // now recompose 837 cbFirst = pArgToDel - pszDeletedLine; 838 cb = cbFirst // length up to pArgToDel 839 + strlen(pAfter) // length of remainder 840 + 1; // null terminator; 841 if (pszLineToInsert = (PSZ)malloc(cb)) 842 { 843 if (cbFirst) 844 memcpy(pszLineToInsert, pszDeletedLine, cbFirst); 845 strcpy(pszLineToInsert + cbFirst, 846 pAfter); 847 } 848 else 849 arc = ERROR_NOT_ENOUGH_MEMORY; 824 850 } 825 851 else
Note:
See TracChangeset
for help on using the changeset viewer.