summaryrefslogtreecommitdiff
path: root/x2p
diff options
context:
space:
mode:
authorjdhedden@1979.usna.com <jdhedden@1979.usna.com>2004-03-18 20:25:50 +0000
committerDave Mitchell <davem@fdisolutions.com>2004-03-24 22:16:30 +0000
commit7cc8f6889f2ec8914bba5135c912be352f638471 (patch)
treede28bfa2255fcf4425aeed7e80f302309ebcfedc /x2p
parentda0b61dd4c6bf78c70cbb82bfd7d9e2c4748080a (diff)
downloadperl-7cc8f6889f2ec8914bba5135c912be352f638471.tar.gz
[perl #27748] 'find2perl' bug: -exec causes chdir error
From: "jdhedden@1979.usna.com (via RT)" <perlbug-followup@perl.org> Message-ID: <rt-3.0.8-27748-82270.2.99482909739062@perl.org> Cwd code was planted in the output executable after the exit, so was never run. p4raw-id: //depot/perl@22586
Diffstat (limited to 'x2p')
-rw-r--r--x2p/find2perl.PL11
1 files changed, 8 insertions, 3 deletions
diff --git a/x2p/find2perl.PL b/x2p/find2perl.PL
index 679ca3c05c..67022eef11 100644
--- a/x2p/find2perl.PL
+++ b/x2p/find2perl.PL
@@ -290,6 +290,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 +366,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