summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas König <a.koenig@mind.de>2002-01-09 12:12:37 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2002-01-09 13:00:09 +0000
commita0804c9e85747bb3f67fb765c9f7a6e0cb9e18d1 (patch)
treef092cfc0538cfa03dd40652b6079c36e750d12a8
parent302427c1e87e8d5309107114c84a87ad6357c6b9 (diff)
downloadperl-a0804c9e85747bb3f67fb765c9f7a6e0cb9e18d1.tar.gz
Re: Weird Malformed warning in bleadperl
Message-ID: <m3itabbzoq.fsf@anima.de> p4raw-id: //depot/perl@14148
-rw-r--r--regexec.c2
-rwxr-xr-xt/op/pat.t16
2 files changed, 16 insertions, 2 deletions
diff --git a/regexec.c b/regexec.c
index 06f0d8eb57..3e6ba65026 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 6f33f15498..467e0a29d0 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";
}