diff options
author | drh <> | 2022-07-03 14:25:47 +0000 |
---|---|---|
committer | drh <> | 2022-07-03 14:25:47 +0000 |
commit | f28727f61e270ecbd58e52318d3895990ff66fe5 (patch) | |
tree | cbad8ba0c9ce4d08c1183835fa4403aa524ce96f /ext/misc/regexp.c | |
parent | a57ac0a82738d5da8177c276f0904fe0089fad81 (diff) | |
download | sqlite-f28727f61e270ecbd58e52318d3895990ff66fe5.tar.gz sqlite-f28727f61e270ecbd58e52318d3895990ff66fe5.zip |
Fix the initial-prefix optimization for the REGEXP extension such that it
works even if the prefix contains characters that require a 3-byte UTF8
encoding. This should fix the problem reported by
[forum:/forumpost/96692f8ba5|forum post 96692f8ba5].
FossilOrigin-Name: c94595a6e15490b432f099fefbe2429fa19287f7bdc86332cba0fd1e08f65bd6
Diffstat (limited to 'ext/misc/regexp.c')
-rw-r--r-- | ext/misc/regexp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/misc/regexp.c b/ext/misc/regexp.c index b626ca424..52973cc73 100644 --- a/ext/misc/regexp.c +++ b/ext/misc/regexp.c @@ -685,7 +685,7 @@ static const char *re_compile(ReCompiled **ppRe, const char *zIn, int noCase){ pRe->zInit[j++] = (unsigned char)(0xc0 | (x>>6)); pRe->zInit[j++] = 0x80 | (x&0x3f); }else if( x<=0xffff ){ - pRe->zInit[j++] = (unsigned char)(0xd0 | (x>>12)); + pRe->zInit[j++] = (unsigned char)(0xe0 | (x>>12)); pRe->zInit[j++] = 0x80 | ((x>>6)&0x3f); pRe->zInit[j++] = 0x80 | (x&0x3f); }else{ |