Commit af10378a authored by Hiroshi Inoue's avatar Hiroshi Inoue

Fix a bug in multibyte_strchr().

parent 867901db
...@@ -253,18 +253,18 @@ unsigned char * ...@@ -253,18 +253,18 @@ unsigned char *
pg_mbschr(int csc, const unsigned char *string, unsigned int character) pg_mbschr(int csc, const unsigned char *string, unsigned int character)
{ {
int mb_st = 0; int mb_st = 0;
unsigned char *s; const unsigned char *s, *rs = NULL;
s = (unsigned char *) string;
for(;;) for(s = string; *s ; s++)
{ {
mb_st = pg_CS_stat(mb_st, (unsigned char) *s, csc); mb_st = pg_CS_stat(mb_st, (unsigned char) *s, csc);
if (mb_st == 0 && (*s == character || *s == 0)) if (mb_st == 0 && (*s == character))
{
rs = s;
break; break;
else
s++;
} }
return (s); }
return (rs);
} }
int int
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment