From a patch and test sent by Renée Bäcker in
<
48B271A3.80808@smart-websolutions.de>
p4raw-id: //depot/perl@34234
return s;
case '*':
case ' ':
- if (s[1] == '-') /* Additional switches on #! line. */
- return s+2;
+ while( *s == ' ' )
+ ++s;
+ if (s[0] == '-') /* Additional switches on #! line. */
+ return s+1;
break;
case '-':
case 0:
BEGIN { require "./test.pl"; }
-plan(tests => 69);
+plan(tests => 70);
use Config;
stdin => 'zomtek',
);
is( $r, "affe\n", '-E works outside of the block created by -n' );
+
+# RT #30660
+
+$filename = tempfile();
+SKIP: {
+ open my $f, ">$filename" or skip( "Can't write temp file $filename: $!" );
+ print $f <<'SWTEST';
+#!perl -w -iok
+print "$^I\n";
+SWTEST
+ close $f or die "Could not close: $!";
+ $r = runperl(
+ progfile => $filename,
+ );
+ like( $r, qr/ok/, 'Spaces on the #! line (#30660)' );
+}