From e6e233fd64d15a03eaa185e06980dec9ecafa55a Mon Sep 17 00:00:00 2001 From: stasoid Date: Thu, 2 Jan 2025 13:23:45 +0500 Subject: [PATCH] LibCore: Correctly pass arguments with spaces to Process on Windows --- Libraries/LibCore/ProcessWindows.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Libraries/LibCore/ProcessWindows.cpp b/Libraries/LibCore/ProcessWindows.cpp index 784553ed0ba..5fd5566dc08 100644 --- a/Libraries/LibCore/ProcessWindows.cpp +++ b/Libraries/LibCore/ProcessWindows.cpp @@ -48,7 +48,9 @@ ErrorOr Process::spawn(ProcessSpawnOptions const& options) else builder.appendff("\"{}\" ", options.executable); - builder.join(' ', options.arguments); + for (auto arg : options.arguments) + builder.appendff("\"{}\" ", arg); + builder.append('\0'); ByteBuffer command_line = TRY(builder.to_byte_buffer());