Changeset 123 for trunk/src/helpers/configsys.c
- Timestamp:
- Dec 14, 2001, 11:41:33 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/configsys.c
r117 r123 91 91 } 92 92 93 arc = doshLoadTextFile(pcszFile, 94 ppszContents); 95 96 if (arc == NO_ERROR) 93 if (!(arc = doshLoadTextFile(pcszFile, 94 ppszContents))) 97 95 { 98 96 // convert all \r\n to \n … … 316 314 ULONG cbCopyTo) // out: sizeof(*pszCopyTo) 317 315 { 318 PSZ p = csysFindKey(pcszSearchIn, pcszKey, NULL, NULL),316 PSZ p, 319 317 prc = NULL; 320 318 321 if (p )319 if (p = csysFindKey(pcszSearchIn, pcszKey, NULL, NULL)) 322 320 { 323 321 prc = p + strlen(pcszKey); … … 326 324 // copy to pszCopyTo 327 325 ULONG cb; 328 PSZ pEOL = strhFindEOL(prc, &cb);329 if (pEOL )326 PSZ pEOL; 327 if (pEOL = strhFindEOL(prc, &cb)) 330 328 { 331 329 if (cb > cbCopyTo) … … 370 368 { 371 369 BOOL fIsAllUpperCase = FALSE; 372 PSZ pKey = csysFindKey(*ppszBuf, 373 pcszKey, 374 NULL, 375 &fIsAllUpperCase), 370 PSZ pKey, 376 371 pReturn = NULL; 377 if (pKey) 372 if (pKey = csysFindKey(*ppszBuf, 373 pcszKey, 374 NULL, 375 &fIsAllUpperCase)) 378 376 { 379 377 // key found in file: … … 381 379 382 380 // replace existing parameter 383 PSZ pOldParam = pKey + strlen(pcszKey);384 // pOldParam now has the old parameter, which we385 // will overwrite now; pOldParam points into *ppszBuf386 387 if (pOldParam)388 { 381 PSZ pOldParam; 382 if (pOldParam = pKey + strlen(pcszKey)) 383 { 384 // pOldParam now has the old parameter, which we 385 // will overwrite now; pOldParam points into *ppszBuf 386 389 387 ULONG ulOldParamOfs = pOldParam - *ppszBuf; 390 388 391 PSZ pEOL = strhFindEOL(pOldParam, NULL); 392 // pEOL now has first end-of-line after the parameter 393 394 if (pEOL) 389 PSZ pEOL; 390 if (pEOL = strhFindEOL(pOldParam, NULL)) 395 391 { 392 // pEOL now has first end-of-line after the parameter 393 396 394 // char count to replace 397 395 ULONG ulToReplace = pEOL - pOldParam; … … 477 475 BOOL fIsAllUpperCase = FALSE; 478 476 PSZ pStartOfLine = NULL; 479 PSZ pKey = csysFindKey(pszSearchIn, 480 pszKey, 481 &pStartOfLine, 482 &fIsAllUpperCase); 477 PSZ pKey; 483 478 BOOL brc = FALSE; 484 479 485 if (pKey) 486 { 487 PSZ pEOL = strhFindEOL(pKey, NULL); 488 // pEOL now has first end-of-line after the key 489 if (pEOL) 490 { 480 if (pKey = csysFindKey(pszSearchIn, 481 pszKey, 482 &pStartOfLine, 483 &fIsAllUpperCase)) 484 { 485 PSZ pEOL; 486 if (pEOL = strhFindEOL(pKey, NULL)) 487 { 488 // pEOL now has first end-of-line after the key; 491 489 // go to first character after EOL 492 490 while ( (*pEOL) … … 604 602 605 603 // First, check if the new-line string has a "=" char 606 PSZ pSep = strchr(pManip->pszNewLine, '=');607 if (pSep )604 PSZ pSep; 605 if (pSep = strchr(pManip->pszNewLine, '=')) 608 606 { 609 607 // yes: separate in two strings … … 751 749 // Manip.pszSearchString has the search string 752 750 // before whose line we must insert 753 PSZ pFound = strhistr(*ppszContents,754 pManip->pszVerticalSearchString);755 if (pFound)751 PSZ pFound; 752 if (pFound = strhistr(*ppszContents, 753 pManip->pszVerticalSearchString)) 756 754 { 757 755 // search string found: … … 777 775 // Manip.pszSearchString has the search string 778 776 // after whose line we must insert 779 PSZ pFound = strhistr(*ppszContents, pManip->pszVerticalSearchString); 780 if (pFound) 777 PSZ pFound; 778 if (pFound = strhistr(*ppszContents, 779 pManip->pszVerticalSearchString)) 781 780 { 782 781 // search string found:
Note:
See TracChangeset
for help on using the changeset viewer.