]> granicus.if.org Git - php/commitdiff
Search in PATH before explicit_path. This resolves conflict between Microsoft and...
authorFrank M. Kromann <fmk@php.net>
Mon, 2 Aug 2004 17:54:49 +0000 (17:54 +0000)
committerFrank M. Kromann <fmk@php.net>
Mon, 2 Aug 2004 17:54:49 +0000 (17:54 +0000)
win32/build/confutils.js

index 76d91cc038a69f7a50cd2f481f5f6c571a6ddc19..00c1a6d1d7c20f8ac5700a2eecc8c6c6546ec0bc 100644 (file)
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-// $Id: confutils.js,v 1.42 2004-07-07 12:25:10 edink Exp $
+// $Id: confutils.js,v 1.43 2004-08-02 17:54:49 fmk Exp $
 
 var STDOUT = WScript.StdOut;
 var STDERR = WScript.StdErr;
@@ -456,7 +456,20 @@ function search_paths(thing_to_find, explicit_path, env_name)
 
        thing_to_find = thing_to_find.replace(new RegExp("/", "g"), "\\");
 
-       if (explicit_path != null) {
+       if (env_name != null) {
+               env = WshShell.Environment("Process").Item(env_name);
+               env = env.split(";");
+               for (i = 0; i < env.length; i++) {
+                       file = glob(env[i] + "\\" + thing_to_find);
+                       if (file) {
+                               found = true;
+                               place = true;
+                               break;
+                       }
+               }
+       }
+
+       if (!found && explicit_path != null) {
                if (typeof(explicit_path) == "string") {
                        explicit_path = explicit_path.split(";");
                }
@@ -472,19 +485,6 @@ function search_paths(thing_to_find, explicit_path, env_name)
                }
        }
 
-       if (!found && env_name != null) {
-               env = WshShell.Environment("Process").Item(env_name);
-               env = env.split(";");
-               for (i = 0; i < env.length; i++) {
-                       file = glob(env[i] + "\\" + thing_to_find);
-                       if (file) {
-                               found = true;
-                               place = true;
-                               break;
-                       }
-               }
-       }
-
        if (found && place == true) {
                STDOUT.WriteLine(" <in default path>");
        } else if (found) {