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:
@ -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
|
||||||
|
Reference in New Issue
Block a user