mirror of
https://github.com/reactos/reactos.git
synced 2024-10-30 19:41:57 +00:00
27 lines
467 B
C
27 lines
467 B
C
|
#include <stdlib.h>
|
||
|
#include <mbstring.h>
|
||
|
|
||
|
int isleadbyte(int byte);
|
||
|
|
||
|
/*
|
||
|
* not correct
|
||
|
*
|
||
|
* @implemented
|
||
|
*/
|
||
|
unsigned char * _mbspbrk(const unsigned char *s1, const unsigned char *s2)
|
||
|
{
|
||
|
const unsigned char* p;
|
||
|
|
||
|
while (*s1)
|
||
|
{
|
||
|
for (p = s2; *p; p += (isleadbyte(*p) ? 2 : 1))
|
||
|
{
|
||
|
if (*p == *s1)
|
||
|
if (!isleadbyte(*p) || (*(p+1) == *(s1 + 1)))
|
||
|
return (unsigned char*)s1;
|
||
|
}
|
||
|
s1 += (isleadbyte(*s1) ? 2 : 1);
|
||
|
}
|
||
|
return NULL;
|
||
|
}
|