CXUX_BROKEN_CONSTANT_CONVERT isn't used anymore.
[p5sagit/p5-mst-13.2.git] / x2p / find2perl.PL
index 679ca3c..cc6c6d8 100644 (file)
@@ -215,6 +215,7 @@ while (@ARGV) {
         my $prog = shift;
         $prog =~ s/'/\\'/g;
         $out .= tab . "eval {$prog}";
+       $print_needed = 0;
     } elsif ($_ eq 'depth') {
         $find = 'finddepth';
         next;
@@ -265,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")';
 }
 
 
@@ -290,6 +293,14 @@ $declaresubs
 
 END
 
+if (exists $init{doexec}) {
+    print <<'END';
+use Cwd ();
+my $cwd = Cwd::cwd();
+
+END
+}  
+
 if (exists $init{ls}) {
     print <<'END';
 my @rwx = qw(--- --x -w- -wx r-- r-x rw- rwx);
@@ -358,9 +369,6 @@ END
 if (exists $init{doexec}) {
     print <<'END';
 
-use Cwd ();
-my $cwd = Cwd::cwd();
-
 sub doexec ($@) {
     my $ok = shift;
     my @command = @_; # copy so we don't try to s/// aliases to constants