Utils: Don't resolve relative paths in ProcessArgs::prepareCommand

Part of an attempt to disentangle streamline environment creation/setup.

Searching is expensive and needs currently the proper environment.

Change-Id: I95d93abf6c0cedeb8ba0b7a447345cd033ac2f25
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2022-11-16 09:27:18 +01:00
parent fd17724597
commit 33ea6f2433

View File

@@ -632,12 +632,10 @@ void ProcessArgs::addArgs(QString *args, const QStringList &inArgs)
bool ProcessArgs::prepareCommand(const CommandLine &cmdLine, QString *outCmd, ProcessArgs *outArgs,
const Environment *env, const FilePath *pwd)
{
FilePath executable = cmdLine.executable();
const QString arguments = cmdLine.arguments();
if (env && executable.isRelativePath())
executable = env->searchInPath(executable.toString());
const FilePath executable = cmdLine.executable();
if (executable.isEmpty())
return false;
const QString arguments = cmdLine.arguments();
ProcessArgs::SplitError err;
*outArgs = ProcessArgs::prepareArgs(arguments, &err, executable.osType(), env, pwd);
if (err == ProcessArgs::SplitOk) {