Change 11029 by jhi@alpha on 2001/06/29 14:06:50
Subject: Re: Bug report: split splits on wrong pattern
From: Radu Greab <[EMAIL PROTECTED]>
Date: Wed, 27 Jun 2001 21:50:52 +0300
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/perl/pp_ctl.c#272 edit
... //depot/perl/t/op/split.t#24 edit
Differences ...
==== //depot/perl/pp_ctl.c#272 (text) ====
Index: perl/pp_ctl.c
--- perl/pp_ctl.c.~1~ Fri Jun 29 08:15:05 2001
+++ perl/pp_ctl.c Fri Jun 29 08:15:05 2001
@@ -147,8 +147,11 @@
if (!PM_GETRE(pm)->prelen && PL_curpm)
pm = PL_curpm;
- else if (strEQ("\\s+", PM_GETRE(pm)->precomp))
- pm->op_pmflags |= PMf_WHITE;
+ else
+ if (strEQ("\\s+", PM_GETRE(pm)->precomp))
+ pm->op_pmflags |= PMf_WHITE;
+ else
+ pm->op_pmflags &= ~PMf_WHITE;
/* XXX runtime compiled output needs to move to the pad */
if (pm->op_pmflags & PMf_KEEP) {
==== //depot/perl/t/op/split.t#24 (xtext) ====
Index: perl/t/op/split.t
--- perl/t/op/split.t.~1~ Fri Jun 29 08:15:05 2001
+++ perl/t/op/split.t Fri Jun 29 08:15:05 2001
@@ -5,7 +5,7 @@
@INC = '../lib';
}
-print "1..44\n";
+print "1..45\n";
$FS = ':';
@@ -244,3 +244,13 @@
print "ok 44\n";
}
+{
+ # check that PMf_WHITE is cleared after \s+ is used
+ # reported in <20010627113312.RWGY6087.viemta06@localhost>
+ my $r;
+ foreach my $pat ( qr/\s+/, qr/ll/ ) {
+ $r = join ':' => split($pat, "hello cruel world");
+ }
+ print "not " unless $r eq "he:o cruel world";
+ print "ok 45\n";
+}
End of Patch.