You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-commits@perl.apache.org by rj...@apache.org on 2020/08/04 21:07:19 UTC

svn commit: r1880585 - /perl/Apache-Test/trunk/lib/Apache/TestConfig.pm

Author: rjung
Date: Tue Aug  4 21:07:19 2020
New Revision: 1880585

URL: http://svn.apache.org/viewvc?rev=1880585&view=rev
Log:
Our implementation of "which" should not search
for a program in the elements of PATH when program
already contains a path.

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

Modified: perl/Apache-Test/trunk/lib/Apache/TestConfig.pm
URL: http://svn.apache.org/viewvc/perl/Apache-Test/trunk/lib/Apache/TestConfig.pm?rev=1880585&r1=1880584&r2=1880585&view=diff
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/TestConfig.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/TestConfig.pm Tue Aug  4 21:07:19 2020
@@ -1782,6 +1782,11 @@ sub which {
 
     return undef unless $program;
 
+    # No need to search PATH components
+    # if $program already contains a path
+    return $program if !OSX and !WINFU and
+        $program =~ /\// and -f $program and -x $program;
+
     my @dirs = File::Spec->path();
 
     require Config;