Changeset 551 for trunk/dll/strips.c
- Timestamp:
- Feb 28, 2007, 2:33:51 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/dll/strips.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/strips.c
r371 r551 25 25 // Chop line at CR or NL 26 26 PSZ psz = strchr(pszSrc, '\r'); 27 27 28 if (psz) 28 29 *psz = 0; … … 36 37 // Convert newline to nul, return pointer to next or NULL 37 38 PSZ psz = strchr(pszSrc, '\n'); 39 38 40 if (psz) { 39 41 *psz = 0; … … 43 45 } 44 46 45 void strip_trail_char (char *pszStripChars,char *pszSrc)47 void strip_trail_char(char *pszStripChars, char *pszSrc) 46 48 { 47 49 char *psz; 48 50 49 if (pszSrc && *pszSrc && pszStripChars && *pszStripChars) {51 if (pszSrc && *pszSrc && pszStripChars && *pszStripChars) { 50 52 psz = pszSrc + strlen(pszSrc) - 1; 51 53 // while not empty and tail char in strip list 52 while (*pszSrc && strchr(pszStripChars, *psz) != NULL) {54 while (*pszSrc && strchr(pszStripChars, *psz) != NULL) { 53 55 *psz = 0; 54 56 psz--; … … 57 59 } 58 60 59 void strip_lead_char (char *pszStripChars,char *pszSrc)61 void strip_lead_char(char *pszStripChars, char *pszSrc) 60 62 { 61 63 char *psz = pszSrc; 62 64 63 if (pszSrc && *pszSrc && pszStripChars && *pszStripChars) {65 if (pszSrc && *pszSrc && pszStripChars && *pszStripChars) { 64 66 // while lead char in strip list 65 while (*psz && strchr(pszStripChars,*psz) != NULL)67 while (*psz && strchr(pszStripChars, *psz) != NULL) 66 68 psz++; 67 if (psz != pszSrc)68 memmove(pszSrc, psz,strlen(psz) + 1);69 if (psz != pszSrc) 70 memmove(pszSrc, psz, strlen(psz) + 1); 69 71 } 70 72 } 71
Note:
See TracChangeset
for help on using the changeset viewer.
