This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix for [perl #28963]: find2perl was sometimes generating
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Wed, 28 Apr 2004 18:28:07 +0000 (18:28 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Wed, 28 Apr 2004 18:28:07 +0000 (18:28 +0000)
invalid code.

p4raw-id: //depot/perl@22749

x2p/find2perl.PL

index b99bb49..cc6c6d8 100644 (file)
@@ -266,7 +266,9 @@ while (@ARGV) {
 }
 
 if ($print_needed) {
-    $out .= "\n" . tab . '&& print("$name\n")';
+    my $t = tab;
+    if ($t !~ /&&\s*$/) { $t .= '&& ' }
+    $out .= "\n" . $t . 'print("$name\n")';
 }