This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Properly handle filled /il regnodes and multi-char folds
authorKarl Williamson <khw@cpan.org>
Sat, 16 Nov 2019 22:44:42 +0000 (15:44 -0700)
committerKarl Williamson <khw@cpan.org>
Thu, 21 Nov 2019 19:55:47 +0000 (12:55 -0700)
commit95815e9df4dca7d5909d369abff1a1c4a779de0b
treefa6b2d6dc566e056fc2ae14477b41fbdd8d8f2d4
parente6769f93f413fd6d2ccd494444da8113892c2531
Properly handle filled /il regnodes and multi-char folds

Previously we were ignoring this possibility.  Suppose a pattern being
compiled under /il contains 'SS', and that it so happens that a regnode
becomes filled with the first 'S', so that the next regnode would begin
with the second one.  If at runtime, the locale is UTF-8, the pattern
should match match a LATIN SHARP S.  Until this commit, it wouldn't.
The commit just extends the current mechanism used in this situation (of
a filled regnode) for non-/l patterns.

If the locale isn't a UTF-8 one, the 'SS' sequence shouldn't match the
SHARP S, and it won't, but we have to construct the node so that it can
handle the UTF-8 case.
regcomp.c
t/re/pat.t