Changeset 63 for trunk/src/helpers/configsys.c
- Timestamp:
- Apr 25, 2001, 8:55:35 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/configsys.c
r47 r63 163 163 *@@changed V0.9.7 (2001-01-15) [umoeller]: moved this here from stringh.c; renamed from strhFindKey 164 164 *@@changed V0.9.7 (2001-01-15) [umoeller]: now checking for tabs too 165 *@@changed V0.9.11 (2001-04-25) [umoeller]: this never found lines which had leading spaces, fixed 165 166 */ 166 167 … … 180 181 p = strhistr(p, pcszKey); 181 182 182 if ((p) && (p >= pcszSearchIn)) 183 if ( (p) 184 && (p >= pcszSearchIn) 185 ) 183 186 { 184 187 // make sure the key is at the beginning of a line 185 188 // by going backwards until we find a char != " " 186 189 const char *pStartOfLine = p; 187 while ( ( (*pStartOfLine == ' ') 188 || (*pStartOfLine == '\t') // allow tabs too 189 ) 190 && (pStartOfLine > pcszSearchIn) 190 191 // fixed this V0.9.11 (2001-04-25) [umoeller] 192 while ( (pStartOfLine > pcszSearchIn) 193 && ( (*(pStartOfLine - 1) == ' ') 194 || (*(pStartOfLine - 1) == '\t') // allow tabs too 195 ) 191 196 ) 192 pStartOfLine--;197 --pStartOfLine; 193 198 194 199 // if we're at the beginning of a line or … … 368 373 ulOldParamOfs, 369 374 ulToReplace, 370 &strReplaceWith); 375 strReplaceWith.psz, 376 strReplaceWith.ulLength); // adjusted V0.9.11 (2001-04-22) [umoeller] 371 377 372 378 xstrClear(&strReplaceWith); … … 1006 1012 } 1007 1013 1008 1014 // testcase 1015 1016 /* int main() 1017 { 1018 PSZ pszContents = NULL; 1019 if (0 == csysLoadConfigSys(NULL, &pszContents)) 1020 { 1021 CHAR szValue[1000]; 1022 PSZ pszValue = csysGetParameter(pszContents, 1023 "IFS=", 1024 szValue, 1025 sizeof(szValue)); 1026 if (pszValue) 1027 printf("Value: %s", szValue); 1028 } 1029 1030 return (0); 1031 } */
Note:
See TracChangeset
for help on using the changeset viewer.