1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Fix a bug in multibyte_strchr().

This commit is contained in:
Hiroshi Inoue
2002-04-04 01:36:17 +00:00
parent 867901db9e
commit af10378ab0

View File

@ -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