]> git.lizzy.rs Git - plan9front.git/blob - sys/src/libc/port/strspn.c
libregexp: improve the transition to next available thread, instruction, and generation
[plan9front.git] / sys / src / libc / port / strspn.c
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 }