Change 18015 by rgs@rgs-home on 2002/10/12 20:22:37 The -0 command-line switch wasn't setting $/ at compile-time. Move the initialization of $/ just after switch parsing (it was done after yyparse().)
Affected files ... .... //depot/perl/perl.c#454 edit .... //depot/perl/t/run/switches.t#6 edit Differences ... ==== //depot/perl/perl.c#454 (text) ==== Index: perl/perl.c --- perl/perl.c#453~17953~ Wed Oct 2 05:55:29 2002 +++ perl/perl.c Sat Oct 12 13:22:37 2002 @@ -1339,6 +1339,7 @@ } } switch_end: + sv_setsv(get_sv("/", TRUE), PL_rs); if ( #ifndef SECURE_INTERNAL_GETENV @@ -1537,12 +1538,6 @@ SvREFCNT_dec(PL_e_script); PL_e_script = Nullsv; } - -/* - Not sure that this is still the right place to do this now that we - no longer use PL_nrs. HVDS 2001/09/09 -*/ - sv_setsv(get_sv("/", TRUE), PL_rs); if (PL_do_undump) my_unexec(); ==== //depot/perl/t/run/switches.t#6 (text) ==== Index: perl/t/run/switches.t --- perl/t/run/switches.t#5~14510~ Thu Jan 31 14:48:13 2002 +++ perl/t/run/switches.t Sat Oct 12 13:22:37 2002 @@ -9,7 +9,7 @@ require "./test.pl"; -plan(tests => 19); +plan(tests => 20); # due to a bug in VMS's piping which makes it impossible for runperl() # to emulate echo -n (ie. stdin always winds up with a newline), these @@ -63,6 +63,12 @@ prog => 's/\n/-/g;$_.=q(/)', ); is( $r, 'abc-def--ghi-jkl-mno--pq-/', '-0777 (slurp mode)' ); + +$r = runperl( + switches => [ '-066' ], + prog => 'BEGIN { print "($/)" } print "[$/]"', +); +is( $r, "(\066)[\066]", '$/ set at compile-time' ); # Tests for -c End of Patch.