utf8_fold_flags = 0;
goto do_exactf_utf8;
}
+
+ /* Any 'ss' in the pattern should have been replaced by regcomp,
+ * so we don't have to worry here about this single special case
+ * in the Latin1 range */
fold_array = PL_fold_latin1;
folder = foldEQ_latin1;
- /* XXX This uses the full utf8 fold because if the pattern contains
- * 'ss' it could match LATIN_SMALL_LETTER SHARP_S in the string.
- * There could be a new node type, say EXACTFU_SS, which is
- * generated by regcomp only if there is an 'ss', and then every
- * other case could goto do_exactf_non_utf8;*/
- goto do_exactf_utf8;
+ goto do_exactf_non_utf8;
case EXACTF:
if (UTF_PATTERN || utf8_target) {
prog->substrs->data[i].utf8_substr = sv;
sv_utf8_upgrade(sv);
if (SvVALID(prog->substrs->data[i].substr)) {
- const U8 flags = BmFLAGS(prog->substrs->data[i].substr);
- if (flags & FBMcf_TAIL) {
+ if (SvTAIL(prog->substrs->data[i].substr)) {
/* Trim the trailing \n that fbm_compile added last
time. */
SvCUR_set(sv, SvCUR(sv) - 1);
/* Whilst this makes the SV technically "invalid" (as its
buffer is no longer followed by "\0") when fbm_compile()
adds the "\n" back, a "\0" is restored. */
- }
- fbm_compile(sv, flags);
+ fbm_compile(sv, FBMcf_TAIL);
+ } else
+ fbm_compile(sv, 0);
}
if (prog->substrs->data[i].substr == prog->check_substr)
prog->check_utf8 = sv;
SV* sv = newSVsv(prog->substrs->data[i].utf8_substr);
if (sv_utf8_downgrade(sv, TRUE)) {
if (SvVALID(prog->substrs->data[i].utf8_substr)) {
- const U8 flags
- = BmFLAGS(prog->substrs->data[i].utf8_substr);
- if (flags & FBMcf_TAIL) {
+ if (SvTAIL(prog->substrs->data[i].utf8_substr)) {
/* Trim the trailing \n that fbm_compile added last
time. */
SvCUR_set(sv, SvCUR(sv) - 1);
- }
- fbm_compile(sv, flags);
- }
+ fbm_compile(sv, FBMcf_TAIL);
+ } else
+ fbm_compile(sv, 0);
+ }
} else {
SvREFCNT_dec(sv);
sv = &PL_sv_undef;