From: Jarkko Hietaniemi Date: Fri, 12 Jan 2001 15:33:41 +0000 (+0000) Subject: One more UTF-8 fix from Inaba Hiroto. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=699c3c3425f2b312fd24050e39cded6eb124bea2;p=p5sagit%2Fp5-mst-13.2.git One more UTF-8 fix from Inaba Hiroto. p4raw-id: //depot/perl@8415 --- diff --git a/pp.c b/pp.c index 2d49cf1..784c7bf 100644 --- a/pp.c +++ b/pp.c @@ -5873,7 +5873,8 @@ PP(pp_split) s = m; } } - else if ((rx->reganch & RE_USE_INTUIT) && !rx->nparens + else if (do_utf8 == ((rx->reganch & ROPT_UTF8) != 0) && + (rx->reganch & RE_USE_INTUIT) && !rx->nparens && (rx->reganch & ROPT_CHECK_ALL) && !(rx->reganch & ROPT_ANCH)) { int tail = (rx->reganch & RE_INTUIT_TAIL); diff --git a/regexec.c b/regexec.c index dca2a44..e85f45f 100644 --- a/regexec.c +++ b/regexec.c @@ -443,8 +443,6 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos, #endif restart: - other_last = Nullch; - /* Find a possible match in the region s..strend by looking for the "check" substring in the region corrected by start/end_shift. */ if (flags & REXEC_SCREAM) { @@ -1462,7 +1460,8 @@ Perl_regexec_flags(pTHX_ register regexp *prog, char *stringarg, register char * PL_reg_ganch = strbeg; } - if (!(flags & REXEC_CHECKED) && prog->check_substr != Nullsv) { + if (do_utf8 == (UTF!=0) && + !(flags & REXEC_CHECKED) && prog->check_substr != Nullsv) { re_scream_pos_data d; d.scream_olds = &scream_olds; diff --git a/t/pragma/utf8.t b/t/pragma/utf8.t index 8e4d296..9137f36 100755 --- a/t/pragma/utf8.t +++ b/t/pragma/utf8.t @@ -10,7 +10,7 @@ BEGIN { } } -print "1..105\n"; +print "1..106\n"; my $test = 1; @@ -554,3 +554,13 @@ sub nok_bytes { print "ok $test\n"; $test++; # 105 } + +{ + use utf8; + + my @a = split(/\xFE/, "\xFF\xFE\xFD"); + + print "not " unless @a == 2 && $a[0] eq "\xFF" && $a[1] eq "\xFD"; + print "ok $test\n"; + $test++; # 106 +}