1 #include <u.h> 2 #include <libc.h> 3 #define N 256 4 5 char* 6 strpbrk(char *s, char *b) 7 { 8 char map[N]; 9 10 memset(map, 0, N); 11 for(;;) { 12 map[*b] = 1; 13 if(*b++ == 0) 14 break; 15 } 16 while(map[*s++] == 0) 17 ; 18 if(*--s) 19 return s; 20 return 0; 21 } 22