LibCore: Correctly pass arguments with spaces to Process on Windows

This commit is contained in:
stasoid 2025-01-02 13:23:45 +05:00 committed by Andrew Kaster
parent 1173b14c43
commit e6e233fd64
Notes: github-actions[bot] 2025-02-06 22:16:16 +00:00

View file

@ -48,7 +48,9 @@ ErrorOr<Process> 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());