From be2774dd81da77661511280fda868a02e4be87eb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 5 Nov 2018 15:25:59 +0200 Subject: Only search for external tools (compilers, linkers, etc) in PATH Specifically, omit the current executable's directory on Windows since there is no reason for them to be found there automagically and this can lead to surprising behavior (for example, our MinGW GCC being used instead of the user's even though the user's is in PATH before ours). --- build2/utility.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'build2/utility.cxx') diff --git a/build2/utility.cxx b/build2/utility.cxx index 4da2195..b5f5e29 100644 --- a/build2/utility.cxx +++ b/build2/utility.cxx @@ -148,10 +148,10 @@ namespace build2 } process_path - run_search (const char*& args0, const location& l) + run_search (const char*& args0, bool path_only, const location& l) try { - return process::path_search (args0); + return process::path_search (args0, dir_path () /* fallback */, path_only); } catch (const process_error& e) { @@ -162,10 +162,11 @@ namespace build2 run_search (const path& f, bool init, const dir_path& fallback, + bool path_only, const location& l) try { - return process::path_search (f, init, fallback); + return process::path_search (f, init, fallback, path_only); } catch (const process_error& e) { -- cgit v1.1