summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-12-22 23:45:35 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-12-22 23:45:35 +0000
commitb8d68ded2ba9139a0c1050157b6f240617f5dd65 (patch)
tree4a7ab7019c39ce77d5b7b83519d9767851f765d1 /regexec.c
parentbc517b45fdfb539b223ef3bf8d22272436835518 (diff)
downloadperl-b8d68ded2ba9139a0c1050157b6f240617f5dd65.tar.gz
Small tweaks.
p4raw-id: //depot/perl@13856
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/regexec.c b/regexec.c
index 4fe7889afb..1a8a8e7d2f 100644
--- a/regexec.c
+++ b/regexec.c
@@ -393,11 +393,22 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos,
SV *dsv = PERL_DEBUG_PAD_ZERO(0);
#endif
+ if (prog->reganch & ROPT_UTF8) {
+ DEBUG_r(PerlIO_printf(Perl_debug_log,
+ "UTF-8 regex...\n"));
+ PL_reg_flags |= RF_utf8;
+ }
+
DEBUG_r({
- char*s = UTF ? sv_uni_display(dsv, sv, 60, 0) : strpos;
- int len = UTF ? strlen(s) : strend - strpos;
+ char *s = PL_reg_match_utf8 ?
+ sv_uni_display(dsv, sv, 60, 0) : strpos;
+ int len = PL_reg_match_utf8 ?
+ strlen(s) : strend - strpos;
if (!PL_colorset)
reginitcolors();
+ if (PL_reg_match_utf8)
+ DEBUG_r(PerlIO_printf(Perl_debug_log,
+ "UTF-8 target...\n"));
PerlIO_printf(Perl_debug_log,
"%sGuessing start of match, REx%s `%s%.60s%s%s' against `%s%.*s%s%s'...\n",
PL_colors[4],PL_colors[5],PL_colors[0],
@@ -411,9 +422,6 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos,
);
});
- if (prog->reganch & ROPT_UTF8)
- PL_reg_flags |= RF_utf8;
-
if (prog->minlen > CHR_DIST((U8*)strend, (U8*)strpos)) {
DEBUG_r(PerlIO_printf(Perl_debug_log,
"String too short... [re_intuit_start]\n"));