diff --git a/src/util/subprocess.h b/src/util/subprocess.h index c45a570d5f1..ff812d7c1a9 100644 --- a/src/util/subprocess.h +++ b/src/util/subprocess.h @@ -1124,11 +1124,16 @@ inline void Popen::execute_process() noexcept(false) std::wstring_convert> converter; std::wstring argument; std::wstring command_line; + bool first_arg = true; for (auto arg : this->vargs_) { + if (!first_arg) { + command_line += L" "; + } else { + first_arg = false; + } argument = converter.from_bytes(arg); util::quote_argument(argument, command_line, false); - command_line += L" "; } // CreateProcessW can modify szCmdLine so we allocate needed memory