Once again syncing after too long an absence
[p5sagit/p5-mst-13.2.git] / x2p / find2perl.PL
index 25d0135..4d74d06 100644 (file)
@@ -37,6 +37,7 @@ my \$perlpath = "$Config{perlpath}";
 print OUT <<'!NO!SUBS!';
 use strict;
 use vars qw/$statdone/;
+use File::Spec::Functions 'curdir';
 my $startperl = "#! $perlpath -w";
 
 #
@@ -57,7 +58,7 @@ my @roots = ();
 while ($ARGV[0] =~ /^[^-!(]/) {
     push(@roots, shift);
 }
-@roots = ('.') unless @roots;
+@roots = (curdir()) unless @roots;
 for (@roots) { $_ = &quote($_) }
 my $roots = join(', ', @roots);
 
@@ -674,6 +675,7 @@ sub n {
 
 sub quote {
     my $string = shift;
+    $string =~ s/\\/\\\\/g;
     $string =~ s/'/\\'/g;
     "'$string'";
 }