Reinstate #11125, hopefully making MakeMaker to pass
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / testlib.pm
index d80f2a2..043a6d4 100644 (file)
@@ -1,8 +1,19 @@
 package ExtUtils::testlib;
-$VERSION = substr q$Revision: 1.11 $, 10;
-# $Id: testlib.pm,v 1.11 1996/05/31 08:27:07 k Exp $
-
-use lib qw(blib/arch blib/lib);
+$VERSION = 1.15;
+
+use Cwd;
+use File::Spec;
+
+# So the tests can chdir around and not break @INC.
+# We use getcwd() because otherwise rel2abs will blow up under taint
+# mode pre-5.8.  We detaint is so @INC won't be tainted.  This is
+# no worse, and probably better, than just shoving an untainted, 
+# relative "blib/lib" onto @INC.
+my $cwd;
+BEGIN {
+    ($cwd) = getcwd() =~ /(.*)/;
+}
+use lib map File::Spec->rel2abs($_, $cwd), qw(blib/arch blib/lib);
 1;
 __END__
 
@@ -12,7 +23,7 @@ ExtUtils::testlib - add blib/* directories to @INC
 
 =head1 SYNOPSIS
 
-C<use ExtUtils::testlib;>
+  use ExtUtils::testlib;
 
 =head1 DESCRIPTION