mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
Modification for compatibility with crtdll.
svn path=/trunk/; revision=6879
This commit is contained in:
parent
bcee43d68f
commit
08dcc0e1a6
1 changed files with 13 additions and 21 deletions
|
@ -10,32 +10,24 @@
|
|||
|
||||
#include <msvcrt/mbstring.h>
|
||||
|
||||
char *strrchr(const char* szSearch, int cFor);
|
||||
extern int __mb_cur_max;
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
unsigned char * _mbsrchr(const unsigned char *src, unsigned int val)
|
||||
{
|
||||
if (__mb_cur_max > 1)
|
||||
unsigned int c;
|
||||
unsigned char *match = NULL;
|
||||
|
||||
if (!src)
|
||||
return NULL;
|
||||
|
||||
while (1)
|
||||
{
|
||||
unsigned int c;
|
||||
unsigned char *match = NULL;
|
||||
|
||||
if (!src)
|
||||
return NULL;
|
||||
|
||||
while (1)
|
||||
{
|
||||
c = _mbsnextc(src);
|
||||
if (c == val)
|
||||
match = (unsigned char*)src;
|
||||
if (!c)
|
||||
return match;
|
||||
src += (c > 255) ? 2 : 1;
|
||||
}
|
||||
c = _mbsnextc(src);
|
||||
if (c == val)
|
||||
match = (unsigned char*)src;
|
||||
if (!c)
|
||||
return match;
|
||||
src += (c > 255) ? 2 : 1;
|
||||
}
|
||||
|
||||
return strrchr(src, val);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue