Commit
68067e4e501e2ae1c0fb44558b6aa5c0a80a4143 inadvertently
broke regular expression /i matching under locale. The tests for this
were defective, so the breakage was not caught. A later commit will fix
the tests, but this commit restores the functionality.
It also casts the input parameter to some functions to be U8 to make
sure that optimizing compilers can omit bounds checks
PERL_ARGS_ASSERT_NEW_CTYPE;
- for (i = 0; i ; i++) {
- if (isUPPER_LC(i))
- PL_fold_locale[i] = toLOWER_LC(i);
- else if (isLOWER_LC(i))
- PL_fold_locale[i] = toUPPER_LC(i);
+ for (i = 0; i < 256; i++) {
+ if (isUPPER_LC((U8) i))
+ PL_fold_locale[i] = toLOWER_LC((U8) i);
+ else if (isLOWER_LC((U8) i))
+ PL_fold_locale[i] = toUPPER_LC((U8) i);
else
PL_fold_locale[i] = i;
}