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/cli/init.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'build2/cli') diff --git a/build2/cli/init.cxx b/build2/cli/init.cxx index bad2533..d9fec08 100644 --- a/build2/cli/init.cxx +++ b/build2/cli/init.cxx @@ -118,7 +118,13 @@ namespace build2 try { - pp = process::path_search (cli, true); // Can throw. + // Only search in PATH (specifically, omitting the current + // executable's directory on Windows). + // + pp = process::path_search (cli, + true /* init */, + dir_path () /* fallback */, + true /* path_only */); args[0] = pp.recall_string (); if (verb >= 3) -- cgit v1.1