]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r340835:
authorYuri Pankov <yuripv@FreeBSD.org>
Sat, 8 Dec 2018 19:45:05 +0000 (19:45 +0000)
committerYuri Pankov <yuripv@FreeBSD.org>
Sat, 8 Dec 2018 19:45:05 +0000 (19:45 +0000)
commitcf15c0f2f51bca632caba6bae1a2253c33565307
tree8c009786b15d3d92214b07d8b7680bff823bb2b9
parent110d0dd3e2db7327ddc186acfb1defe1f10a5313
MFC r340835:
regexec: fix processing multibyte strings.

Matcher function incorrectly assumed that moffset that we get from
findmust is in bytes. Fix this by introducing a stepback function,
taking short path if MB_CUR_MAX is 1, and going back byte-by-byte,
checking if we have a legal character sequence otherwise.

PR: 153502
Reviewed by: pfg, kevans
Differential revision: https://reviews.freebsd.org/D18297
lib/libc/regex/engine.c
lib/libc/tests/regex/Makefile
lib/libc/tests/regex/multibyte.sh [new file with mode: 0755]