char *check_at = Nullch; /* check substr found at this pos */
#ifdef DEBUGGING
char *i_strpos = strpos;
- static SV *dsv;
- if (!dsv)
- dsv = newSVpvn("", 0);
+ SV *dsv = PERL_DEBUG_PAD_ZERO(0);
#endif
DEBUG_r({
if (do_utf8) {
STRLEN len;
+ /* The ibcmp_utf8() uses to_uni_fold() which is more
+ * correct folding for Unicode than using lowercase.
+ * However, it doesn't work quite fully since the folding
+ * is a one-to-many mapping and the regex optimizer is
+ * unaware of this, so it may throw out good matches.
+ * Fortunately, not getting this right is allowed
+ * for Unicode Regular Expression Support level 1,
+ * only one-to-one matching is required. --jhi */
if (c1 == c2)
while (s <= e) {
if ( utf8_to_uvchr((U8*)s, &len) == c1
- && regtry(prog, s) )
+ && (ln == 1 ||
+ ibcmp_utf8(s, do_utf8, m, UTF, ln)) )
goto got_it;
s += len;
}
else
while (s <= e) {
UV c = utf8_to_uvchr((U8*)s, &len);
- if ( (c == c1 || c == c2) && regtry(prog, s) )
+ if ( (c == c1 || c == c2)
+ && (ln == 1 ||
+ ibcmp_utf8(s, do_utf8, m, UTF, ln)) )
goto got_it;
s += len;
}
SV* oreplsv = GvSV(PL_replgv);
bool do_utf8 = DO_UTF8(sv);
#ifdef DEBUGGING
- static SV *dsv;
- if (!dsv)
- dsv = newSVpvn("", 0);
+ SV *dsv = PERL_DEBUG_PAD_ZERO(0);
#endif
PL_regcc = 0;
New(22,PL_reg_start_tmp, PL_reg_start_tmpl, char*);
}
+#ifdef DEBUGGING
+ sv_setpvn(PERL_DEBUG_PAD(0), "", 0);
+ sv_setpvn(PERL_DEBUG_PAD(1), "", 0);
+ sv_setpvn(PERL_DEBUG_PAD(2), "", 0);
+#endif
+
/* XXXX What this code is doing here?!!! There should be no need
to do this again and again, PL_reglastparen should take care of
this! --ilya*/
#endif
register bool do_utf8 = PL_reg_match_utf8;
#ifdef DEBUGGING
- static SV *dsv0;
- static SV *dsv1;
- static SV *dsv2;
- if (!dsv0)
- dsv0 = newSVpvn("", 0);
- if (!dsv1)
- dsv1 = newSVpvn("", 0);
- if (!dsv2)
- dsv2 = newSVpvn("", 0);
+ SV *dsv0 = PERL_DEBUG_PAD_ZERO(0);
+ SV *dsv1 = PERL_DEBUG_PAD_ZERO(1);
+ SV *dsv2 = PERL_DEBUG_PAD_ZERO(2);
#endif
#ifdef DEBUGGING
c1 = *(PL_bostr + ln);
}
else { c1 = (U8)*STRING(text_node); }
- if (OP(next) == EXACTF)
+ if (OP(text_node) == EXACTF || OP(text_node) == REFF)
c2 = PL_fold[c1];
- else if (OP(text_node) == EXACTFL)
+ else if (OP(text_node) == EXACTFL || OP(text_node) == REFFL)
c2 = PL_fold_locale[c1];
else
c2 = c1;
}
else { c1 = (U8)*STRING(text_node); }
- if (OP(text_node) == EXACTF)
+ if (OP(text_node) == EXACTF || OP(text_node) == REFF)
c2 = PL_fold[c1];
- else if (OP(text_node) == EXACTFL)
+ else if (OP(text_node) == EXACTFL || OP(text_node) == REFFL)
c2 = PL_fold_locale[c1];
else
c2 = c1;
if (!UTF) {
c2 = c1 = *s;
- if (OP(text_node) == EXACTF)
+ if (OP(text_node) == EXACTF || OP(text_node) == REFF)
c2 = PL_fold[c1];
- else if (OP(text_node) == EXACTFL)
+ else if (OP(text_node) == EXACTFL || OP(text_node) == REFFL)
c2 = PL_fold_locale[c1];
}
else { /* UTF */
- if (OP(text_node) == EXACTF) {
+ if (OP(text_node) == EXACTF || OP(text_node) == REFF) {
STRLEN ulen1, ulen2;
U8 tmpbuf1[UTF8_MAXLEN*2+1];
U8 tmpbuf2[UTF8_MAXLEN*2+1];