PL_reg_flags |= RF_utf8;
if (prog->minlen > CHR_DIST((U8*)strend, (U8*)strpos)) {
- DEBUG_r(PerlIO_printf(Perl_debug_log, "String too short...\n"));
+ DEBUG_r(PerlIO_printf(Perl_debug_log,
+ "String too short... [re_intuit_start]\n"));
goto fail;
}
strbeg = (sv && SvPOK(sv)) ? strend - SvCUR(sv) : strpos;
}
minlen = prog->minlen;
- if (do_utf8 && !(prog->reganch & ROPT_CANY_SEEN)) {
- if (utf8_distance((U8*)strend, (U8*)startpos) < minlen) goto phooey;
- }
- else {
- if (strend - startpos < minlen) goto phooey;
+ if (strend - startpos < minlen) {
+ DEBUG_r(PerlIO_printf(Perl_debug_log,
+ "String too short [regexec_flags]...\n"));
+ goto phooey;
}
/* Check validity of program. */
d.scream_olds = &scream_olds;
d.scream_pos = &scream_pos;
s = re_intuit_start(prog, sv, s, strend, flags, &d);
- if (!s)
+ if (!s) {
+ DEBUG_r(PerlIO_printf(Perl_debug_log, "Not present...\n"));
goto phooey; /* not present */
+ }
}
DEBUG_r({
char *l = locinput;
char *e = s + ln;
STRLEN len;
+
if (do_utf8)
while (s < e) {
+ UV uv;
+
if (l >= PL_regeol)
sayNO;
- if (*((U8*)s) != utf8_to_uvchr((U8*)l, &len))
- sayNO;
- s++;
- l += len;
+ uv = NATIVE_TO_UNI(*(U8*)s);
+ if (UTF8_IS_START(uv)) {
+ len = UTF8SKIP(s);
+ if (memNE(s, l, len))
+ sayNO;
+ l += len;
+ s += len;
+ } else {
+ if (uv != utf8_to_uvchr((U8*)l, &len))
+ sayNO;
+ l += len;
+ s ++;
+ }
}
else
while (s < e) {
if (*((U8*)l) != utf8_to_uvchr((U8*)s, &len))
sayNO;
s += len;
- l++;
+ l ++;
}
locinput = l;
nextchr = UCHARAT(locinput);