From 3a8314f7938c2e8b8db940e2a5626cd40346f6cd Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 12 Dec 2023 16:06:25 +0100 Subject: [PATCH] WebAssembly: Support emsdk path with spaces on Linux/macOS The command passed to bash as argument needs to be quoted. Task-number: QTCREATORBUG-29981 Change-Id: I0e91ab4c088f8cd4e5a2df82604ea86cf73369fc Reviewed-by: Alessandro Portale --- src/plugins/webassembly/webassemblyemsdk.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/webassembly/webassemblyemsdk.cpp b/src/plugins/webassembly/webassemblyemsdk.cpp index 4ba3563c2ec..12c4d649678 100644 --- a/src/plugins/webassembly/webassemblyemsdk.cpp +++ b/src/plugins/webassembly/webassemblyemsdk.cpp @@ -51,7 +51,9 @@ static QString emSdkEnvOutput(const FilePath &sdkRoot) emSdkEnv.setCommand(CommandLine(scriptFile)); } else { // File needs to be source'd, not executed. - emSdkEnv.setCommand({sdkRoot.withNewPath("bash"), {"-c", ". " + scriptFile.path()}}); + CommandLine cmd{sdkRoot.withNewPath("bash"), {"-c"}}; + cmd.addCommandLineAsSingleArg({".", {scriptFile.path()}}); + emSdkEnv.setCommand(cmd); } emSdkEnv.runBlocking(); const QString result = emSdkEnv.allOutput();