Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include <u.h>
2
#include <libc.h>
3
 
4
#define	N	256
5
 
6
long
7
strspn(char *s, char *b)
8
{
9
	char map[N], *os;
10
 
11
	memset(map, 0, N);
12
	while(*b)
13
		map[*(uchar *)b++] = 1;
14
	os = s;
15
	while(map[*(uchar *)s++])
16
		;
17
	return s - os - 1;
18
}