From: Andreas König Date: Wed, 9 Jan 2002 11:12:37 +0000 (+0100) Subject: Re: Weird Malformed warning in bleadperl X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a0804c9e85747bb3f67fb765c9f7a6e0cb9e18d1;p=p5sagit%2Fp5-mst-13.2.git Re: Weird Malformed warning in bleadperl Message-ID: p4raw-id: //depot/perl@14148 --- diff --git a/regexec.c b/regexec.c index 06f0d8e..3e6ba65 100644 --- a/regexec.c +++ b/regexec.c @@ -3879,7 +3879,7 @@ S_regrepeat(pTHX_ regnode *p, I32 max) case SANY: if (do_utf8) { loceol = PL_regeol; - while (scan < loceol) { + while (scan < loceol && hardcount < max) { scan += UTF8SKIP(scan); hardcount++; } diff --git a/t/op/pat.t b/t/op/pat.t index 6f33f15..467e0a2 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -6,7 +6,7 @@ $| = 1; -print "1..845\n"; +print "1..846\n"; BEGIN { chdir 't' if -d 't'; @@ -2637,4 +2637,18 @@ print "# some Unicode properties\n"; } print join("", @c) eq $s ? "ok 845\n" : "not ok 845\n"; + + my $t1 = "Q003\n\n\x{e4}\x{f6}\n\nQ004\n\n\x{e7}"; # test only chars < 256 + my $r1 = ""; + while ($t1 =~ / \G ( .+? ) \n\s+ ( .+? ) ( $ | \n\s+ ) /xgcs) { + $r1 .= $1 . $2; + } + + my $t2 = $t1 . "\x{100}"; # repeat with a larger char + my $r2 = ""; + while ($t2 =~ / \G ( .+? ) \n\s+ ( .+? ) ( $ | \n\s+ ) /xgcs) { + $r2 .= $1 . $2; + } + $r2 =~ s/\x{100}//; + print $r1 eq $r2 ? "ok 846\n" : "not ok 846\n"; }