From: Hugo van der Sanden Date: Sun, 31 Jan 1999 16:16:14 +0000 (+0000) Subject: update change#2670 to later version X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=43a1600645d3a38ec94bb7a1c90813c610fb1534;p=p5sagit%2Fp5-mst-13.2.git update change#2670 to later version Message-Id: <199901311616.QAA17673@crypt.compulink.co.uk> Subject: Re: [PATCH 5.005_54] Evalled substitution parsing p4raw-link: @2670 on //depot/cfgperl: e9fa98b27b08c227248dead8a754ba7c9269fec0 p4raw-id: //depot/perl@2892 --- diff --git a/t/op/subst.t b/t/op/subst.t index 65deab2..2d15df4 100755 --- a/t/op/subst.t +++ b/t/op/subst.t @@ -6,7 +6,7 @@ BEGIN { require Config; import Config; } -print "1..82\n"; +print "1..83\n"; $x = 'foo'; $_ = "x"; @@ -371,5 +371,8 @@ eval q% s/a/"b"}/e %; print ($@ =~ /Bad evalled substitution/ ? "ok 81\n" : "not ok 81\n"); eval q% ($_ = "x") =~ s/(.)/"$1 "/e %; print +($_ eq "x " and !length $@) ? "ok 82\n" : "not ok 82\n# \$_ eq $_, $@\n"; +$x = $x = 'interp'; +eval q% ($_ = "x") =~ s/x(($x)*)/"$1"/e %; +print +($_ eq '' and !length $@) ? "ok 83\n" : "not ok 83\n# \$_ eq $_, $@\n"; diff --git a/toke.c b/toke.c index 4ab20c2..211f9b2 100644 --- a/toke.c +++ b/toke.c @@ -1849,7 +1849,9 @@ int yylex(PERL_YYLEX_PARAM_DECL) PL_lex_state = LEX_INTERPCONCAT; return ')'; } - if (PL_lex_inwhat == OP_SUBST && PL_lex_repl && SvCOMPILED(PL_lex_repl)) { + if (PL_lex_inwhat == OP_SUBST && PL_linestr == PL_lex_repl + && SvCOMPILED(PL_lex_repl)) + { if (PL_bufptr != PL_bufend) croak("Bad evalled substitution pattern"); PL_lex_repl = Nullsv;