Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature_posix/sys/src/libc/port/strpbrk.c – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

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