home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
109.lha
/
PD_C
/
lib
/
strcspn.c
< prev
next >
Wrap
Text File
|
1986-11-20
|
597b
|
24 lines
/*
* strcspn - find length of initial segment of s consisting entirely
* of characters not from reject
*/
SIZET
strcspn(s, reject)
CONST char *s;
CONST char *reject;
{
register CONST char *scan;
register CONST char *rscan;
register SIZET count;
count = 0;
for (scan = s; *scan != '\0'; scan++) {
for (rscan = reject; *rscan != '\0';) /* ++ moved down. */
if (*scan == *rscan++)
return(count);
count++;
}
return(count);
}