From: Frank M. Kromann Date: Mon, 2 Aug 2004 17:54:49 +0000 (+0000) Subject: Search in PATH before explicit_path. This resolves conflict between Microsoft and... X-Git-Tag: PRE_ZEND_VM_DISPATCH_PATCH~273 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=07979b3ce4bcd2507aade3ae4250139e5bfdcfbf;p=php Search in PATH before explicit_path. This resolves conflict between Microsoft and cygwin tools with the same name. --- diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 76d91cc038..00c1a6d1d7 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -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(" "); } else if (found) {