Skip to content

Commit 0a56ed1

Browse files
committed
Merge bitcoin/bitcoin#32567: subprocess: Backport upstream changes
e63a703 subprocess: Don't add an extra whitespace at end of Windows command line (laanwj) Pull request description: A list of the backported PRs: - arun11299/cpp-subprocess#119 The following PRs were skipped for backporting: - arun11299/cpp-subprocess#118 because there is no changes in the header code. Required for bitcoin/bitcoin#32566. ACKs for top commit: laanwj: Code review ACK e63a703 Tree-SHA512: 69a74aa7f9c611a9ec910e27161c5e9e147067d37f8335953cd3875fcc88dc840a2f7b206bb603f22507159e406b1449f1dc4702fffe890bb824672641b4feed
2 parents 54e406a + e63a703 commit 0a56ed1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/util/subprocess.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1124,11 +1124,16 @@ inline void Popen::execute_process() noexcept(false)
11241124
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
11251125
std::wstring argument;
11261126
std::wstring command_line;
1127+
bool first_arg = true;
11271128

11281129
for (auto arg : this->vargs_) {
1130+
if (!first_arg) {
1131+
command_line += L" ";
1132+
} else {
1133+
first_arg = false;
1134+
}
11291135
argument = converter.from_bytes(arg);
11301136
util::quote_argument(argument, command_line, false);
1131-
command_line += L" ";
11321137
}
11331138

11341139
// CreateProcessW can modify szCmdLine so we allocate needed memory

0 commit comments

Comments
 (0)