Skip to content

Commit 5689f30

Browse files
author
Fabrice Bellard
committed
fixed handling of 8 bit unicode strings in RegExp (regression introduced by commit a4ac84d)
1 parent a4ac84d commit 5689f30

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎libregexp.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3190,7 +3190,7 @@ int lre_exec(uint8_t **capture,
31903190
stack_buf = alloca(alloca_size);
31913191

31923192
cptr = cbuf + (cindex << cbuf_type);
3193-
if (0 < cindex && cindex < clen && s->is_unicode) {
3193+
if (0 < cindex && cindex < clen && s->cbuf_type == 2) {
31943194
const uint16_t *p = (const uint16_t *)cptr;
31953195
if (is_lo_surrogate(*p) && is_hi_surrogate(p[-1])) {
31963196
cptr = (const uint8_t *)(p - 1);

0 commit comments

Comments
 (0)