Changeset 144 for trunk/src/helpers/stringh.c
- Timestamp:
- Feb 26, 2002, 9:28:01 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/stringh.c
r143 r144 873 873 * 874 874 *@@added V0.9.6 (2000-11-12) [umoeller] 875 *@@changed V0.9.18 (2002-02-23) [umoeller]: fixed end char check 875 876 */ 876 877 877 878 BOOL strhIsWord(PCSZ pcszBuf, 878 879 PCSZ p, // in: start of word 879 ULONG cbSearch, 880 ULONG cbSearch, // in: length of word 880 881 PCSZ pcszBeginChars, // suggestion: "\x0d\x0a ()/\\-,." 881 882 PCSZ pcszEndChars) // suggestion: "\x0d\x0a ()/\\-,.:;" 882 883 { 883 BOOL fEndOK = FALSE;884 885 884 // check previous char 886 885 if ( (p == pcszBuf) … … 890 889 // OK, valid begin char: 891 890 // check end char 892 CHAR cNextChar = *(p + cbSearch); 893 if (cNextChar == 0) 894 fEndOK = TRUE; 891 CHAR cNextChar; 892 if (!(cNextChar = p[cbSearch])) 893 // null terminator: 894 return TRUE; 895 895 else 896 896 { 897 char *pc = strchr(pcszEndChars, cNextChar); 898 if (pc) 897 // not null terminator: check if char is 898 // in the list of valid end chars 899 if (strchr(pcszEndChars, cNextChar)) 900 { 899 901 // OK, is end char: avoid doubles of that char, 900 902 // but allow spaces 901 if ( (cNextChar+1 != *pc) 902 || (cNextChar+1 == ' ') 903 || (cNextChar+1 == 0) 903 // fixed V0.9.18 (2002-02-23) [umoeller] 904 CHAR cNextNext = p[cbSearch + 1]; 905 if ( (cNextNext != cNextChar) 906 || (cNextNext == ' ') 907 || (cNextNext == 0) 904 908 ) 905 fEndOK = TRUE; 906 } 907 } 908 909 return (fEndOK); 909 return TRUE; 910 } 911 } 912 } 913 914 return FALSE; 910 915 } 911 916
Note:
See TracChangeset
for help on using the changeset viewer.