The handling for locale \s and \S both assume that the character in
ASCII platforms at 0x20 is a space. This is not necessarily so.
I'm guessing that the code was originally just copied and pasted from
the non-locale space handling code without thinking. That code hard-coded
in the space character, probably to avoid an expensive swash fetch for a
common situation.
);
case SPACEL:
REXEC_FBC_CSCAN_TAINT(
- *s == ' ' || isSPACE_LC_utf8((U8*)s),
+ isSPACE_LC_utf8((U8*)s),
isSPACE_LC(*s)
);
case NSPACE:
);
case NSPACEL:
REXEC_FBC_CSCAN_TAINT(
- !(*s == ' ' || isSPACE_LC_utf8((U8*)s)),
+ !isSPACE_LC_utf8((U8*)s),
!isSPACE_LC(*s)
);
case DIGIT:
if (utf8_target) {
loceol = PL_regeol;
while (hardcount < max && scan < loceol &&
- (*scan == ' ' || isSPACE_LC_utf8((U8*)scan))) {
+ isSPACE_LC_utf8((U8*)scan)) {
scan += UTF8SKIP(scan);
hardcount++;
}
if (utf8_target) {
loceol = PL_regeol;
while (hardcount < max && scan < loceol &&
- !(*scan == ' ' || isSPACE_LC_utf8((U8*)scan))) {
+ !isSPACE_LC_utf8((U8*)scan)) {
scan += UTF8SKIP(scan);
hardcount++;
}