1 Change 27368 by rgs@stencil on 2006/03/03 15:45:32
3 Subject: [PATCH] Re: [perl #38657] -d:Foo=bar broke in 5.8.8
4 From: Jarkko Hietaniemi <jhietaniemi@gmail.com>
5 Date: Thu, 02 Mar 2006 20:21:26 +0200
6 Message-ID: <440737A6.4060606@gmail.com>
10 ... //depot/perl/t/lib/Devel/switchd.pm#3 edit
11 ... //depot/perl/t/run/switchd.t#4 edit
14 Change 27359 by rgs@marais on 2006/03/01 22:39:24
16 Don't put strings with embedded NULs in the environment.
17 This makes things like -d:Foo=bar work again.
21 ... //depot/perl/perl.c#737 edit
23 --- perl.c 2006-03-01 22:18:07.000000000 +0100
24 +++ perl.c 2006-03-01 22:18:04.000000000 +0100
28 sv_catpvn(sv, start, s-start);
29 - Perl_sv_catpvf(aTHX_ sv, " split(/,/,q%c%s%c)", 0, ++s, 0);
30 + /* Don't use NUL as q// delimiter here, this string goes in the
32 + Perl_sv_catpvf(aTHX_ sv, " split(/,/,q{%s});", ++s);
35 my_setenv("PERL5DB", SvPV_nolen_const(sv));
36 --- t/lib/Devel/switchd.pm.dist 2006-03-02 20:02:52.000000000 +0200
37 +++ t/lib/Devel/switchd.pm 2006-03-02 20:12:59.000000000 +0200
39 package Devel::switchd;
40 use strict; BEGIN { } # use strict; BEGIN { ... } to incite [perl #21890]
41 +sub import { print "import<@_>;" }
43 -sub DB { print join(",", caller), ";" }
44 +sub DB { print "DB<", join(",", caller), ">;" }
45 +sub sub { print "sub<$DB::sub>;"; goto &$DB::sub }
48 --- t/run/switchd.t.dist 2006-03-02 19:59:03.000000000 +0200
49 +++ t/run/switchd.t 2006-03-02 20:17:18.000000000 +0200
55 +# This test depends on t/lib/Devel/switchd.pm.
63 switches => [ '-Ilib', '-d:switchd' ],
64 progfile => $filename,
67 - like($r, qr/^main,swdtest.tmp,9;Foo,swdtest.tmp,5;Foo,swdtest.tmp,6;Foo,swdtest.tmp,6;Bar,swdtest.tmp,2;Bar,swdtest.tmp,2;Bar,swdtest.tmp,2;$/i);
68 + like($r, qr/^sub<Devel::switchd::import>;import<Devel::switchd>;DB<main,swdtest.tmp,9>;sub<Foo::foo>;DB<Foo,swdtest.tmp,5>;DB<Foo,swdtest.tmp,6>;DB<Foo,swdtest.tmp,6>;sub<Bar::bar>;DB<Bar,swdtest.tmp,2>;sub<Bar::bar>;DB<Bar,swdtest.tmp,2>;sub<Bar::bar>;DB<Bar,swdtest.tmp,2>;$/);
70 + switches => [ '-Ilib', '-d:switchd=a,42' ],
71 + progfile => $filename,
74 + like($r, qr/^sub<Devel::switchd::import>;import<Devel::switchd a 42>;DB<main,swdtest.tmp,9>;sub<Foo::foo>;DB<Foo,swdtest.tmp,5>;DB<Foo,swdtest.tmp,6>;DB<Foo,swdtest.tmp,6>;sub<Bar::bar>;DB<Bar,swdtest.tmp,2>;sub<Bar::bar>;DB<Bar,swdtest.tmp,2>;sub<Bar::bar>;DB<Bar,swdtest.tmp,2>;$/);