perl-test-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r358943 - /perl/Apache-Test/trunk/lib/Apache/TestConfig.pm
Date Sat, 24 Dec 2005 18:24:46 GMT
Author: stas
Date: Sat Dec 24 10:24:43 2005
New Revision: 358943

URL: http://svn.apache.org/viewcvs?rev=358943&view=rev
Log:
use a crossplatform solution to figure out which paths are relative

Modified:
    perl/Apache-Test/trunk/lib/Apache/TestConfig.pm

Modified: perl/Apache-Test/trunk/lib/Apache/TestConfig.pm
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/lib/Apache/TestConfig.pm?rev=358943&r1=358942&r2=358943&view=diff
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/TestConfig.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/TestConfig.pm Sat Dec 24 10:24:43 2005
@@ -1744,14 +1744,15 @@
     $self->{_apxs}{$q};
 }
 
-# Temporarily untaint PATH
+# return an untainted PATH
 sub untaint_path {
     my $path = shift;
     ($path) = ( $path =~ /(.*)/ );
     # win32 uses ';' for a path separator, assume others use ':'
     my $sep = WIN32 ? ';' : ':';
     # -T disallows relative and empty directories in the PATH
-    return join $sep, grep !m#^(?:[^/]|$)#, split /$sep/, $path;
+    return join $sep, grep File::Spec->file_name_is_absolute($_),
+        grep length($_), split /$sep/, $path;
 }
 
 sub pop_dir {



Mime
View raw message