summaryrefslogtreecommitdiff
path: root/strings/my_strchr.c
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2016-05-17 15:27:10 +0400
committerAlexander Barkov <bar@mariadb.org>2016-05-17 15:27:10 +0400
commite7ff281d2e954f9ab7f08a3e1a425a3c59e8f796 (patch)
treee8e3903a609daef952785e28e5c876bafd52ba7b /strings/my_strchr.c
parent7e66a24dfb381290d59786c36e1dc478ad365bd1 (diff)
downloadmariadb-git-e7ff281d2e954f9ab7f08a3e1a425a3c59e8f796.tar.gz
MDEV-6353 my_ismbchar() and my_mbcharlen() refactoring
Diffstat (limited to 'strings/my_strchr.c')
-rw-r--r--strings/my_strchr.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/strings/my_strchr.c b/strings/my_strchr.c
index 0305ef89542..2365731fa03 100644
--- a/strings/my_strchr.c
+++ b/strings/my_strchr.c
@@ -38,7 +38,7 @@
const char *acc_end= (ACC) + (LEN); \
for (ptr_str= (STR) ; ptr_str < (END) ; ptr_str+= mbl) \
{ \
- mbl= my_mbcharlen((CS), *(uchar*)ptr_str); \
+ mbl= my_charlen_fix((CS), ptr_str, (END)); \
if (mbl < 2) \
{ \
DBUG_ASSERT(mbl == 1); \
@@ -63,10 +63,9 @@ end: \
char *my_strchr(CHARSET_INFO *cs, const char *str, const char *end,
pchar c)
{
- uint mbl;
while (str < end)
{
- mbl= my_mbcharlen(cs, *(uchar *)str);
+ uint mbl= my_ismbchar(cs, str, end);
if (mbl < 2)
{
if (*str == c)