From 08dcc0e1a67b3652b194f8701c932ba5498b375e Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Sun, 7 Dec 2003 08:23:18 +0000 Subject: [PATCH] Modification for compatibility with crtdll. svn path=/trunk/; revision=6879 --- reactos/lib/msvcrt/mbstring/mbsrchr.c | 34 ++++++++++----------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/reactos/lib/msvcrt/mbstring/mbsrchr.c b/reactos/lib/msvcrt/mbstring/mbsrchr.c index e0486172186..c0f66f36376 100644 --- a/reactos/lib/msvcrt/mbstring/mbsrchr.c +++ b/reactos/lib/msvcrt/mbstring/mbsrchr.c @@ -10,32 +10,24 @@ #include -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); }