diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2002-12-12 20:35:29 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2002-12-12 20:35:29 +0000 |
commit | f14c76ed18fcf3fc609cea29294703220581a43a (patch) | |
tree | a9f2029f27c012fcaf665e055fb0515058f78bed /regexec.c | |
parent | 7e107e90b7bd52c7fb110ac98da6bb7ab38e8959 (diff) | |
download | perl-f14c76ed18fcf3fc609cea29294703220581a43a.tar.gz |
Integrate from maint-5.8 : changes 18290-1, 18293-5, 18297
p4raw-id: //depot/perl@18299
p4raw-integrated: from //depot/maint-5.8/perl@18298 'copy in'
pod/perlretut.pod (@17645..) pod/perlre.pod (@18080..)
ext/POSIX/t/is.t (@18189..) t/op/subst.t (@18214..)
ext/POSIX/t/posix.t (@18271..) t/op/pat.t (@18276..)
ext/POSIX/POSIX.pod (@18294..) 'merge in' regexec.c (@18095..)
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -1882,9 +1882,12 @@ Perl_regexec_flags(pTHX_ register regexp *prog, char *stringarg, register char * goto phooey; } else if ((c = prog->regstclass)) { - if (minlen && PL_regkind[(U8)OP(prog->regstclass)] != EXACT) + if (minlen) { + I32 op = (U8)OP(prog->regstclass); /* don't bother with what can't match */ - strend = HOPc(strend, -(minlen - 1)); + if (PL_regkind[op] != EXACT && op != CANY) + strend = HOPc(strend, -(minlen - 1)); + } DEBUG_r({ SV *prop = sv_newmortal(); char *s0; @@ -2269,17 +2272,17 @@ S_regmatch(pTHX_ regnode *prog) regprop(prop, scan); { char *s0 = - do_utf8 ? + do_utf8 && OP(scan) != CANY ? pv_uni_display(dsv0, (U8*)(locinput - pref_len), pref0_len, 60, UNI_DISPLAY_REGEX) : locinput - pref_len; int len0 = do_utf8 ? strlen(s0) : pref0_len; - char *s1 = do_utf8 ? + char *s1 = do_utf8 && OP(scan) != CANY ? pv_uni_display(dsv1, (U8*)(locinput - pref_len + pref0_len), pref_len - pref0_len, 60, UNI_DISPLAY_REGEX) : locinput - pref_len + pref0_len; int len1 = do_utf8 ? strlen(s1) : pref_len - pref0_len; - char *s2 = do_utf8 ? + char *s2 = do_utf8 && OP(scan) != CANY ? pv_uni_display(dsv2, (U8*)locinput, PL_regeol - locinput, 60, UNI_DISPLAY_REGEX) : locinput; |