Search in PATH before explicit_path. This resolves conflict between Microsoft and cygwin tools with the same name.

This commit is contained in:
Frank M. Kromann 2004-08-02 17:54:49 +00:00
parent 78306b2d1d
commit 07979b3ce4

View 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) {