From: Adrian M. Enache Date: Sat, 15 Feb 2003 00:37:40 +0000 (+0200) Subject: Re: [perl #20912] UTF8 related glitch + fix X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3b0d546b549c81b8fd7281af083002e289e306d6;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #20912] UTF8 related glitch + fix Message-ID: <20030214223740.GA13575@ratsnest.hole> p4raw-id: //depot/perl@18708 --- diff --git a/pp.c b/pp.c index 4fbcad4..0d531dc 100644 --- a/pp.c +++ b/pp.c @@ -4427,6 +4427,7 @@ PP(pp_split) } /* temporarily switch stacks */ SWITCHSTACK(PL_curstack, ary); + PL_curstackinfo->si_stack = ary; make_mortal = 0; } } @@ -4624,6 +4625,7 @@ PP(pp_split) if (realarray) { if (!mg) { SWITCHSTACK(ary, oldstack); + PL_curstackinfo->si_stack = oldstack; if (SvSMAGICAL(ary)) { PUTBACK; mg_set((SV*)ary); diff --git a/t/op/split.t b/t/op/split.t index 5b8535c..3d7e898 100755 --- a/t/op/split.t +++ b/t/op/split.t @@ -6,7 +6,7 @@ BEGIN { require './test.pl'; } -plan tests => 49; +plan tests => 50; $FS = ':'; @@ -276,3 +276,10 @@ ok(@ary == 3 && is(join (':',@d), 'readin:database:readout', "[perl #18195]") } } + +{ + $p="a,b"; + utf8::upgrade $p; + @a=split(/[, ]+/,$p); + is ("$@-@a-", '-a b-', '#20912 - split() to array with /[]+/ and utf8'); +}