From: Jarkko Hietaniemi Date: Sat, 22 Dec 2001 23:45:35 +0000 (+0000) Subject: Small tweaks. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b8d68ded2ba9139a0c1050157b6f240617f5dd65;p=p5sagit%2Fp5-mst-13.2.git Small tweaks. p4raw-id: //depot/perl@13856 --- diff --git a/handy.h b/handy.h index 35373f4..c792665 100644 --- a/handy.h +++ b/handy.h @@ -428,6 +428,7 @@ Converts the specified character to lowercase. #define toUPPER_uni(c,s,l) to_uni_upper(c,s,l) #define toTITLE_uni(c,s,l) to_uni_title(c,s,l) #define toLOWER_uni(c,s,l) to_uni_lower(c,s,l) +#define toFOLD_uni(c,s,l) to_uni_fold(c,s,l) #define isPSXSPC_uni(c) (isSPACE_uni(c) ||(c) == '\f') #define isBLANK_uni(c) isBLANK(c) /* could be wrong */ diff --git a/regexec.c b/regexec.c index 4fe7889..1a8a8e7 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"));